Class InMemoryZipFactory.InMemoryArchive

    • Constructor Detail

      • InMemoryArchive

        public InMemoryArchive()
    • Method Detail

      • setArchiveComment

        public void setArchiveComment​(@Nullable
                                      String comment)
        Description copied from interface: ZipWriter
        Writes a comment to the archive.
        Specified by:
        setArchiveComment in interface ZipWriter
        Parameters:
        comment - the text to write as a comment.
      • createTextFile

        @NotNull
        public Writer createTextFile​(@NotNull
                                     String name,
                                     @Nullable
                                     Charset charset)
        Creates a text output stream to write into an archive. The character code table depends on the implementation.
        Specified by:
        createTextFile in interface ZipWriter
        Parameters:
        name - file name (relative to the archive root).
        charset - character set to use for this file, or null for use default character set.
        Returns:
        text output stream.
        See Also:
        ZipWriter.createTextFile(String, Charset)
      • createTextFile

        @NotNull
        public Writer createTextFile​(@NotNull
                                     String name,
                                     @Nullable
                                     Charset charset,
                                     long mtimeMillis)

        Creates a new ZIP entry to store plain text data and returns a Writer to it. It's the client's responsibility to close the returned Writer.

        Specified by:
        createTextFile in interface ZipWriter
        Parameters:
        name - the name of the ZIP entry to create (relative path with forward slashes (/)).
        charset - the optional character set to use, or null if the default character set is to be used.
        mtimeMillis - the entry's modification time (@{code mtime}), in milliseconds since epoch.
        Returns:
        the Writer pointing to the newly created ZIP entry. The Writer is already buffered, to there's no need to wrap it into a BufferedWriter.
        See Also:
        ZipWriter.createTextFile(String, Charset, long)
      • createBinaryFile

        @NotNull
        public OutputStream createBinaryFile​(@NotNull
                                             String name,
                                             long mtimeMillis)

        Creates a new ZIP entry to store binary data and returns an OutputStream to it. It's the client's responsibility to close the returned OutputStream.

        Specified by:
        createBinaryFile in interface ZipWriter
        Parameters:
        name - the name of the ZIP entry to create (relative path with forward slashes (/)).
        mtimeMillis - the entry's modification time (@{code mtime}), in milliseconds since epoch.
        Returns:
        the OutputStream pointing to the newly created ZIP entry. The OutputStream is already buffered, to there's no need to wrap it into a BufferedOutputStream.
        See Also:
        ZipWriter.createBinaryFile(String, long)
      • getFileSize

        public long getFileSize​(String name)
        Description copied from interface: ZipReader
        Returns the size of the (uncompressed) file.
        Specified by:
        getFileSize in interface ZipReader
        Parameters:
        name - file name.
        Returns:
        size of file, in bytes; or Long.MIN_VALUE if file doesn't exist.