|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.exorcist.multi.MultiState
public class MultiState
TODO
Constructor Summary | |
---|---|
MultiState(ContentState state)
|
Method Summary | |
---|---|
java.lang.String |
addAttachment(java.io.InputStream data)
Adds a binary attachment. |
void |
endCollection()
|
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 content)
Sets the serialized XML document that represents the content state snapshot. |
void |
startCollection()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiState(ContentState state) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
Method Detail |
---|
public void startCollection() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public void endCollection() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public void setContent(java.io.InputStream content) throws java.io.IOException
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
content
- content XML stream
java.io.IOException
- if the stream can not be readpublic java.io.InputStream getContent() throws java.io.IOException
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 java.lang.String addAttachment(java.io.InputStream data) throws java.io.IOException
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()
getAttachmentHashes
in interface ContentState
public java.io.InputStream getAttachment(java.lang.String hash) throws java.io.IOException, java.lang.IllegalArgumentException
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
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 |