Class ArtifactSinkFactory


  • public final class ArtifactSinkFactory
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static IRawArtifactSink rawWriteToStream​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor artifactDescriptor, java.io.OutputStream destination)
      Returns an IRawArtifactSink instance for writing an artifact in a raw format to the given output stream.
      static IArtifactSink writeToStream​(org.eclipse.equinox.p2.metadata.IArtifactKey artifactKey, java.io.OutputStream destination)
      Returns an IArtifactSink instance for writing an artifact to an output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ArtifactSinkFactory

        public ArtifactSinkFactory()
    • Method Detail

      • writeToStream

        public static IArtifactSink writeToStream​(org.eclipse.equinox.p2.metadata.IArtifactKey artifactKey,
                                                  java.io.OutputStream destination)
        Returns an IArtifactSink instance for writing an artifact to an output stream.

        Note that IArtifactSink.beginWrite() can only be called once on the returned artifact sink, i.e. the returned instance has no support for re-starting the write operation in case the first write attempt fails.

        Parameters:
        artifactKey - The key of the artifact to be written.
        destination - The output stream to write the artifact content to. The ownership of the stream is not transferred, i.e. neither this method nor the returned IArtifactSink will call OutputStream.close() on the stream.
      • rawWriteToStream

        public static IRawArtifactSink rawWriteToStream​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor artifactDescriptor,
                                                        java.io.OutputStream destination)
        Returns an IRawArtifactSink instance for writing an artifact in a raw format to the given output stream.

        Note that IArtifactSink.beginWrite() can only be called once on the returned artifact sink, i.e. the returned instance has no support for re-starting the write operation in case the first write attempt fails.

        Parameters:
        artifactDescriptor - An IArtifactDescriptor specifying artifact and format to be written.
        destination - The output stream to write the raw content to. The ownership of the stream is not transferred, i.e. neither this method nor the returned IRawArtifactSink will call OutputStream.close() on the stream.