Class AbstractZipWriter

    • Constructor Detail

      • AbstractZipWriter

        protected AbstractZipWriter()

        Empty constructor to be used by descendants.

    • Method Detail

      • createTextFile

        @NotNull
        public final Writer createTextFile​(@NotNull
                                           String name,
                                           @Nullable
                                           Charset charset)
                                    throws IOException
        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.
        Throws:
        IOException
        See Also:
        ZipWriter.createTextFile(String, Charset)
      • createTextFile

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

        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.
        Throws:
        ZipException - if a ZIP stream error occurs.
        IOException - if any other I/O error occurs.
        See Also:
        ZipWriter.createTextFile(String, Charset, long)