org.apache.commons.compress.archivers

Class ArchiveOutputStream

    • Method Detail

      • putArchiveEntry

        public abstract void putArchiveEntry(ArchiveEntry entry)                              throws IOException
        Writes the headers for an archive entry to the output stream. The caller must then write the content to the stream and call closeArchiveEntry() to complete the process.
        Parameters:
        entry - describes the entry
        Throws:
        IOException - if an I/O error occurs
      • closeArchiveEntry

        public abstract void closeArchiveEntry()                                throws IOException
        Closes the archive entry, writing any trailer information that may be required.
        Throws:
        IOException - if an I/O error occurs
      • finish

        public abstract void finish()                     throws IOException
        Finishes the addition of entries to this stream, without closing it. Additional data can be written, if the format supports it.
        Throws:
        IOException - if the user forgets to close the entry.
      • createArchiveEntry

        public abstract ArchiveEntry createArchiveEntry(File inputFile,                              String entryName)                                         throws IOException
        Create an archive entry using the inputFile and entryName provided.
        Parameters:
        inputFile - the file to create the entry from
        entryName - name to use for the entry
        Returns:
        the ArchiveEntry set up with details from the file
        Throws:
        IOException - if an I/O error occurs
      • count

        protected void count(int written)
        Increments the counter of already written bytes. Doesn't increment if EOF has been hit (written == -1).
        Parameters:
        written - the number of bytes written
      • count

        protected void count(long written)
        Increments the counter of already written bytes. Doesn't increment if EOF has been hit (written == -1).
        Parameters:
        written - the number of bytes written
        Since:
        1.1
      • getCount

        @Deprecatedpublic int getCount()
        Deprecated. this method may yield wrong results for large archives, use #getBytesWritten instead
        Returns the current number of bytes written to this stream.
        Returns:
        the number of written bytes
      • getBytesWritten

        public long getBytesWritten()
        Returns the current number of bytes written to this stream.
        Returns:
        the number of written bytes
        Since:
        1.1
      • canWriteEntryData

        public boolean canWriteEntryData(ArchiveEntry archiveEntry)
        Whether this stream is able to write the given entry.

        Some archive formats support variants or details that are not supported (yet).

        Parameters:
        archiveEntry - the entry to test
        Returns:
        This implementation always returns true.
        Since:
        1.1

Copyright © 2016 The Apache Software Foundation. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14