public class YDocument
extends java.lang.Object
Constructor and Description |
---|
YDocument()
Constructs a new, empty YDocument
|
YDocument(java.lang.String caseID,
long docID,
byte[] docAsBytes)
Constructs a new YDocument
|
YDocument(java.lang.String caseID,
long docID,
java.io.InputStream docStream)
Constructs a new YDocument
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCaseId()
Gets the case id for this document
|
byte[] |
getDocument()
Gets the binary file stored in this document
|
int |
getDocumentSize()
Gets the size of the store binary file
|
long |
getId()
Gets the document identifier
|
boolean |
hasValidId()
Checks that the document identifier has a valid value
|
void |
setCaseId(java.lang.String id)
Sets the case id for this document
|
void |
setDocument(byte[] doc)
Sets the binary file to be stored in this document
|
void |
setDocument(java.io.File file)
Sets the binary file to be stored in this document
|
void |
setDocument(java.io.InputStream in)
Sets the binary file to be stored in this document
|
void |
setDocument(java.lang.String fileName)
Sets the binary file to be stored in this document
|
void |
setId(long id)
Sets the document identifier
|
void |
writeToFile(java.io.File file)
Writes the binary file stored in this document to a disk file
|
void |
writeToFile(java.lang.String fileName)
Writes the binary file stored in this document to a disk file
|
public YDocument()
public YDocument(java.lang.String caseID, long docID, byte[] docAsBytes)
caseID
- the id of the case the document is a member ofdocID
- the id of the internal binary file. Set it to a negative value if
the document has not yet been stored (and so does not yet have an id)docAsBytes
- a byte array representing the contents of the binary filepublic YDocument(java.lang.String caseID, long docID, java.io.InputStream docStream) throws java.io.IOException
caseID
- the id of the case the document is a member ofdocID
- the id of the internal binary file. Set it to a negative value if
the document has not yet been stored (and so does not yet have an id)docStream
- a stream from which the contents of the binary file may be readjava.io.IOException
- if there's a problem reading from the streampublic long getId()
public void setId(long id)
id
- the document identifier to setpublic boolean hasValidId()
public java.lang.String getCaseId()
public void setCaseId(java.lang.String id)
id
- the case id to set for this documentpublic byte[] getDocument()
public int getDocumentSize()
public void setDocument(byte[] doc)
doc
- a byte array representing the contents of a binary filepublic void setDocument(java.io.File file) throws java.io.IOException
file
- a File object containing a reference to a disk file to be read into
this documentjava.io.IOException
- if there's a problem loading the filepublic void setDocument(java.lang.String fileName) throws java.io.IOException
fileName
- a fully qualified path and file name of a disk file to be read into
this documentjava.io.IOException
- if there's a problem loading the filepublic void setDocument(java.io.InputStream in) throws java.io.IOException
in
- a stream from which the contents of the binary file may be readjava.io.IOException
- if there's a problem loading the filepublic void writeToFile(java.lang.String fileName) throws java.io.IOException
fileName
- a fully qualified path and file name of a disk file to writejava.io.IOException
- if there's a problem writing the filepublic void writeToFile(java.io.File file) throws java.io.IOException
file
- a File object containing a reference to a disk file to be written tojava.io.IOException
- if there's a problem writing the fileCopyright © 2004-2014 The YAWL Foundation.