public interface ModifiableSource extends Source
Source that can be written to.
As far a possible, implementations should provide a kind of transaction or buffering of data written to the source. This is especially important in stream-based systems such as Cocoon where an error that occurs during the processing should lead to cancelling data written to the source.
This is the role of the canCancel(OutputStream) and
cancel(OutputStream) methods.
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCancel(java.io.OutputStream stream)
Can the data sent to an
OutputStream returned by
getOutputStream() be cancelled ? |
void |
cancel(java.io.OutputStream stream)
Cancel the data sent to an
OutputStream returned by
getOutputStream(). |
void |
delete()
Delete the source
|
java.io.OutputStream |
getOutputStream()
Return an
OutputStream to write to. |
exists, getContentLength, getInputStream, getLastModified, getMimeType, getScheme, getURI, getValidity, refreshjava.io.OutputStream getOutputStream()
throws java.io.IOException
OutputStream to write to.
The returned stream must be closed or cancelled by the calling code.java.io.IOExceptionvoid delete()
throws SourceException
SourceExceptionboolean canCancel(java.io.OutputStream stream)
OutputStream returned by
getOutputStream() be cancelled ?void cancel(java.io.OutputStream stream)
throws java.io.IOException
OutputStream returned by
getOutputStream(). Cancelling the stream will also close it.
After cancelling, the stream should no longer be used.
java.io.IOException