|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.exorcist.core.FileContentState
public class FileContentState
Constructor Summary | |
---|---|
FileContentState()
|
Method Summary | |
---|---|
java.lang.String |
addAttachment(java.io.InputStream data)
Adds a binary attachment. |
java.io.InputStream |
getAttachment(java.lang.String hash)
Returns the attachment with the given hash code. |
java.util.Collection |
getAttachmentHashes()
Returns the hashe codes of all the attachments. |
java.io.InputStream |
getContent()
Returns the serialized XML document that represents the content state snapshot. |
void |
removeAttachment(java.lang.String hash)
Removes the attachment with the given hash code. |
void |
setContent(java.io.InputStream input)
Sets the serialized XML document that represents the content state snapshot. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileContentState()
Method Detail |
---|
public java.io.InputStream getContent() throws java.io.IOException
ContentState
The returned input stream should always contain a well-formed XML document although the implementation class might not strictly enforce this. Possible XML parsing exceptions can thus be treated as fatal errors.
The returned input stream belongs to the caller and should be closed when it is no longer used.
getContent
in interface ContentState
java.io.IOException
- if the stream can not be createdpublic void setContent(java.io.InputStream input) throws java.io.IOException
ContentState
The given input stream should contain a well-formed XML document. The implementation class is not required to strictly enforce this requirement to avoid unnecessary processing, but failure to produce a well-formed XML document should still be considered a fatal error.
The given input stream is consumed until it ends or an exception occurs, but it is not closed. It is the responsibility of the caller to properly close the stream.
setContent
in interface ContentState
input
- content XML stream
java.io.IOException
- if the stream can not be readpublic java.lang.String addAttachment(java.io.InputStream data) throws java.io.IOException
ContentState
The given input stream is consumed until it ends or an exception occurs, but it is not closed. It is the responsibility of the caller to properly close the stream.
addAttachment
in interface ContentState
data
- input stream containing the attachment
java.io.IOException
- if the attachment stream could not be readpublic java.util.Collection getAttachmentHashes()
ContentState
getAttachmentHashes
in interface ContentState
public java.io.InputStream getAttachment(java.lang.String hash) throws java.io.IOException, java.lang.IllegalArgumentException
ContentState
getAttachment
in interface ContentState
hash
- SHA-1 hash of the attachment
java.io.IOException
- if the stream can not be created
java.lang.IllegalArgumentException
- if an attachment with the
given hash code does not existpublic void removeAttachment(java.lang.String hash) throws java.lang.IllegalArgumentException
ContentState
removeAttachment
in interface ContentState
hash
- SHA-1 hash of the attachment
java.lang.IllegalArgumentException
- if an attachment with the
given hash code does not exist
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |