public class ProbeArtifactSink extends java.lang.Object implements IArtifactSink
Modifier and Type | Field and Description |
---|---|
private boolean |
aborted |
private org.eclipse.equinox.p2.metadata.IArtifactKey |
artifactKey |
private boolean |
committed |
(package private) ProbeOutputStream |
sink |
Constructor and Description |
---|
ProbeArtifactSink(org.eclipse.equinox.p2.metadata.IArtifactKey artifactKey) |
Modifier and Type | Method and Description |
---|---|
void |
abortWrite()
Method for aborting the write operation.
|
java.io.OutputStream |
beginWrite()
Method for starting the write operation.
|
boolean |
canBeginWrite()
Check if
IArtifactSink.beginWrite() can be called on this instance. |
void |
checkConsistencyWithStatus(org.eclipse.core.runtime.IStatus status) |
int |
committedBytes() |
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.
|
java.util.Set<java.lang.String> |
getFilesInZip() |
static ProbeArtifactSink |
newArtifactSinkFor(org.eclipse.equinox.p2.metadata.IArtifactKey artifactKey) |
boolean |
writeIsAborted() |
boolean |
writeIsCommitted() |
boolean |
writeIsStarted() |
private org.eclipse.equinox.p2.metadata.IArtifactKey artifactKey
ProbeOutputStream sink
private boolean aborted
private boolean committed
public ProbeArtifactSink(org.eclipse.equinox.p2.metadata.IArtifactKey artifactKey)
public static ProbeArtifactSink newArtifactSinkFor(org.eclipse.equinox.p2.metadata.IArtifactKey artifactKey)
public org.eclipse.equinox.p2.metadata.IArtifactKey getArtifactToBeWritten()
IArtifactSink
getArtifactToBeWritten
in interface IArtifactSink
public boolean canBeginWrite()
IArtifactSink
IArtifactSink.beginWrite()
can be called on this instance. This method will typically
return false
if IArtifactSink.commitWrite()
has already been called on this instance,
or if IArtifactSink.beginWrite()
has been called before and the instance doesn't support
re-starting the write operation.canBeginWrite
in interface IArtifactSink
true
if IArtifactSink.beginWrite()
can be called on this instance.public java.io.OutputStream beginWrite()
IArtifactSink
beginWrite
in interface IArtifactSink
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 IArtifactSink.commitWrite()
or
IArtifactSink.abortWrite()
to free any allocated resources.public boolean writeIsStarted()
public void abortWrite()
IArtifactSink
abortWrite
in interface IArtifactSink
public boolean writeIsAborted()
public void commitWrite()
IArtifactSink
OutputStream
returned by IArtifactSink.beginWrite()
.commitWrite
in interface IArtifactSink
public boolean writeIsCommitted()
public int committedBytes()
public java.util.Set<java.lang.String> getFilesInZip() throws java.io.IOException
java.io.IOException
public void checkConsistencyWithStatus(org.eclipse.core.runtime.IStatus status)