Package adams.core.io

Class ZipArchiveManager

    • Field Detail

      • m_BufferSize

        protected int m_BufferSize
        the buffer size to use.
      • m_ZipOut

        protected transient org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream m_ZipOut
        the zip archive stream.
      • m_FileOut

        protected transient FileOutputStream m_FileOut
        the file output stream for the zip archive.
    • Constructor Detail

      • ZipArchiveManager

        public ZipArchiveManager()
    • Method Detail

      • setBufferSize

        public void setBufferSize​(int value)
        Sets the buffer size for the stream.
        Parameters:
        value - the size in bytes
      • getBufferSize

        public int getBufferSize()
        Returns the buffer size for the stream.
        Returns:
        the size in bytes
      • bufferSizeTipText

        public String bufferSizeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the object, which can be displayed in the GUI.
        Specified by:
        getQuickInfo in interface QuickInfoSupporter
        Returns:
        null if no info available, otherwise short string
      • initialize

        public String initialize​(PlaceholderFile output)
        Initializes the archive.
        Specified by:
        initialize in interface ArchiveManager
        Parameters:
        output - the file name for the archive
        Returns:
        null if successful, otherwise error message
      • add

        public String add​(PlaceholderFile data,
                          String name)
        Adds the file to the archive.
        Specified by:
        add in interface ArchiveManager
        Parameters:
        data - the file to add
        name - the name for the file in the archive
        Returns:
        null if successful, otherwise error message
      • add

        public String add​(InputStream data,
                          String name)
        Adds the data from the input stream to the archive. Caller needs to close input stream.
        Specified by:
        add in interface ArchiveManager
        Parameters:
        data - the data to add
        name - the name for the data in the archive
        Returns:
        null if successful, otherwise error message
      • add

        public String add​(byte[] data,
                          String name)
        Adds the data to the archive.
        Specified by:
        add in interface ArchiveManager
        Parameters:
        data - the data to add
        name - the name for the data in the archive
        Returns:
        null if successful, otherwise error message
      • close

        public String close()
        Finalizes the archive.
        Specified by:
        close in interface ArchiveManager
        Returns:
        null if successful, otherwise error message