Class ChangeSetPerformer<I extends ArchiveInputStream<E>,​O extends ArchiveOutputStream<E>,​E extends ArchiveEntry>

  • Type Parameters:
    I - The ArchiveInputStream type.
    O - The ArchiveOutputStream type.
    E - The ArchiveEntry type, must be compatible between the input I and output O stream types.

    public class ChangeSetPerformer<I extends ArchiveInputStream<E>,​O extends ArchiveOutputStream<E>,​E extends ArchiveEntry>
    extends java.lang.Object
    Performs ChangeSet operations on a stream. This class is thread safe and can be used multiple times. It operates on a copy of the ChangeSet. If the ChangeSet changes, a new Performer must be created.
    • Constructor Summary

      Constructors 
      Constructor Description
      ChangeSetPerformer​(ChangeSet<E> changeSet)
      Constructs a ChangeSetPerformer with the changes from this ChangeSet
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ChangeSetResults perform​(I inputStream, O outputStream)
      Performs all changes collected in this ChangeSet on the input stream and streams the result to the output stream.
      ChangeSetResults perform​(ZipFile zipFile, O outputStream)
      Performs all changes collected in this ChangeSet on the ZipFile and streams the result to the output stream.
      • Methods inherited from class java.lang.Object

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

      • ChangeSetPerformer

        public ChangeSetPerformer​(ChangeSet<E> changeSet)
        Constructs a ChangeSetPerformer with the changes from this ChangeSet
        Parameters:
        changeSet - the ChangeSet which operations are used for performing
    • Method Detail

      • perform

        public ChangeSetResults perform​(I inputStream,
                                        O outputStream)
                                 throws java.io.IOException
        Performs all changes collected in this ChangeSet on the input stream and streams the result to the output stream. Perform may be called more than once. This method finishes the stream, no other entries should be added after that.
        Parameters:
        inputStream - the InputStream to perform the changes on
        outputStream - the resulting OutputStream with all modifications
        Returns:
        the results of this operation
        Throws:
        java.io.IOException - if a read/write error occurs
      • perform

        public ChangeSetResults perform​(ZipFile zipFile,
                                        O outputStream)
                                 throws java.io.IOException
        Performs all changes collected in this ChangeSet on the ZipFile and streams the result to the output stream. Perform may be called more than once. This method finishes the stream, no other entries should be added after that.
        Parameters:
        zipFile - the ZipFile to perform the changes on
        outputStream - the resulting OutputStream with all modifications
        Returns:
        the results of this operation
        Throws:
        java.io.IOException - if a read/write error occurs
        Since:
        1.5