org.eclipse.ohf.ihe.xds.source.document
Class Document

java.lang.Object
  extended by org.eclipse.ohf.ihe.xds.source.document.Document

public class Document
extends java.lang.Object

Manages a document to be submitted to the XDS Repository. Holds a reference to associated metadata and a document descriptor.

Since:
IHII Phase 2
Version:
$Revision: 1.3 $
Author:
Sarah Knoop , Glenn Deen

Constructor Summary
Document(byte[] documentByteArray, DocumentDescriptor descriptor)
          Construct a new Document object from the contents of the byte array holding a document of type specified in the docType.
Document(java.io.File file, DocumentDescriptor descriptor)
          Construct a new Document object from the given File object
Document(java.lang.String source, DocumentDescriptor descriptor)
          Construct a new Document object, given path
 
Method Summary
 boolean equals(Document document)
          Tests if the given document holds the same document as the class instance.
 java.lang.String getCanonicalPath()
          Get the canonical path to the document.
 DocumentDescriptor getDescriptor()
          get the descriptor DocumentDescriptor of the document.
 java.lang.String getDocumentData()
          return the internal document data
 java.lang.String getDocumentEntryUUID()
           
 void setDocumentEntryUUID(java.lang.String documentEntryUUID)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Document

public Document(java.io.File file,
                DocumentDescriptor descriptor)
         throws java.io.FileNotFoundException,
                java.io.IOException
Construct a new Document object from the given File object

Parameters:
file -
descriptor - @see org.eclipse.ohf.ihe.xds.source.document.DocumentDescriptor
Throws:
java.io.FileNotFoundException
IOEXCEPTION
java.io.IOException

Document

public Document(java.lang.String source,
                DocumentDescriptor descriptor)
         throws java.io.FileNotFoundException,
                java.io.IOException
Construct a new Document object, given path

Parameters:
source - path to file on system
descriptor - @see org.eclipse.ohf.ihe.xds.source.document.DocumentDescriptor
Throws:
java.io.FileNotFoundException
IOEXCEPTION
java.io.IOException

Document

public Document(byte[] documentByteArray,
                DocumentDescriptor descriptor)
Construct a new Document object from the contents of the byte array holding a document of type specified in the docType.

Parameters:
documentByteArray -
descriptor - @see org.eclipse.ohf.ihe.xds.source.document.DocumentDescriptor
Method Detail

getCanonicalPath

public java.lang.String getCanonicalPath()
Get the canonical path to the document. See File.getCanonicalPath()

Returns:
the path (returns the empty string "" if no path is define. For example if the document was provided as an in memory object, and not read from disk.

getDescriptor

public DocumentDescriptor getDescriptor()
get the descriptor DocumentDescriptor of the document.

Returns:
document descriptor

getDocumentData

public java.lang.String getDocumentData()
return the internal document data

Returns:
String representation of the raw document

getDocumentEntryUUID

public java.lang.String getDocumentEntryUUID()
Returns:
the documentEntryUUID

setDocumentEntryUUID

public void setDocumentEntryUUID(java.lang.String documentEntryUUID)
Parameters:
documentEntryUUID - the documentEntryUUID to set

equals

public boolean equals(Document document)
Tests if the given document holds the same document as the class instance. A result of true requires that both the Type of the document, and the byte level contents of the two document match.

Parameters:
document -
Returns:
true if the Document instances hold the same source document.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object