public interface IArtifactSink
ArtifactSinkFactory
Modifier and Type | Method and Description |
---|---|
void |
abortWrite()
Method for aborting the write operation.
|
OutputStream |
beginWrite()
Method for starting the write operation.
|
boolean |
canBeginWrite()
Check if
beginWrite() can be called on this instance. |
void |
commitWrite()
Method to committing the write operation.
|
org.eclipse.equinox.p2.metadata.IArtifactKey |
getArtifactToBeWritten()
Returns the key of the artifact expected by this instance.
|
org.eclipse.equinox.p2.metadata.IArtifactKey getArtifactToBeWritten()
boolean canBeginWrite()
beginWrite()
can be called on this instance. This method will typically
return false
if commitWrite()
has already been called on this instance,
or if beginWrite()
has been called before and the instance doesn't support
re-starting the write operation.true
if beginWrite()
can be called on this instance.OutputStream beginWrite() throws IllegalStateException, ArtifactSinkException
OutputStream
to write the artifact content to. The ownership of the
stream is not transferred to the caller, i.e. OutputStream.close()
must not be called on the returned instance. Instead, call commitWrite()
or
abortWrite()
to free any allocated resources.IllegalStateException
- if this instance is not in the right state to start a write operation. This
exception will be thrown if and only if canBeginWrite()
returns
false
.ArtifactSinkException
- if an error occurs while starting the write operation.void commitWrite() throws IllegalStateException, ArtifactSinkException
OutputStream
returned by beginWrite()
.IllegalStateException
- if there is no running write operation, i.e. when this method has already been
called, abortWrite()
has been called, or beginWrite()
has not
been called.ArtifactSinkException
- if an error occurs while committing the write operation.void abortWrite() throws ArtifactSinkException
ArtifactSinkException
- if an error occurs while aborting the write operation.Copyright © 2008–2020 Eclipse Foundation. All rights reserved.