Package adams.core.io

Class TarArchiveManager

    • Field Detail

      • m_BufferSize

        protected int m_BufferSize
        the buffer size to use.
      • m_TarOut

        protected transient org.apache.commons.compress.archivers.tar.TarArchiveOutputStream m_TarOut
        the tar archive stream.
      • m_FileOut

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

      • TarArchiveManager

        public TarArchiveManager()
    • Method Detail

      • setCompression

        public void setCompression​(TarUtils.Compression value)
        Sets the compression to use. If TarUtils.Compression.AUTO then compression gets determined based on file extension.
        Parameters:
        value - the compression to use
      • compressionTipText

        public String compressionTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • 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