Interface ZipWriter

    • Method Detail

      • createTextFile

        @NotNull
        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.

        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.
        Since:
        2017.2.4, 2018.1
        See Also:
        createTextFile(String, Charset)
      • createBinaryFile

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

        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.

        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.
        Throws:
        ZipException - if a ZIP stream error occurs.
        IOException - if any other I/O error occurs.
        Since:
        2017.2.4, 2018.1
        See Also:
        createBinaryFile(String)