Package: org.gradle.api.tasks.bundling

## [Java] Class Zip

- org.gradle.api.tasks.bundling.Zip

- Assembles a ZIP archive. The default is to compress the contents of the zip.

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `protected class` | `Zip.ZipCopyActionImpl` | DO NOT REMOVE.

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `ZIP_EXTENSION` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Zip ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected CopyAction` | `createCopyAction()`
    `protected ZipCompressor` | `getCompressor()`
    `ZipEntryCompression` | `getEntryCompression()` Returns the compression level of the entries of the archive.
    `boolean` | `isZip64()` Whether the zip can contain more than 65535 files and/or support files greater than 4GB in size.
    `void` | `setEntryCompression(ZipEntryCompression entryCompression)` Sets the compression level of the entries of the archive.
    `void` | `setZip64(boolean allowZip64)` Enables building zips with more than 65535 files or bigger than 4GB.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractArchiveTask` | `getAppendix, getArchiveName, getArchivePath, getBaseName, getClassifier, getDestinationDir, getExtension, getVersion, into, into, setAppendix, setArchiveName, setBaseName, setClassifier, setDestinationDir, setExtension, setVersion`
    `class AbstractCopyTask` | `copy, createCopyAction, createRootSpec, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, filesMatching, filesNotMatching, filter, filter, filter, from, from, getDirMode, getDuplicatesStrategy, getExcludes, getFileLookup, getFileMode, getFileResolver, getFileSystem, getIncludeEmptyDirs, getIncludes, getInstantiator, getMainSpec, getRootSpec, getSource, include, include, include, include, into, into, isCaseSensitive, rename, rename, rename, setCaseSensitive, setDirMode, setDuplicatesStrategy, setExcludes, setFileMode, setIncludeEmptyDirs, setIncludes, with`

- - ### Field Detail

    - #### public static final String ZIP_EXTENSION

  - ### Constructor Detail

    - #### public Zip()

  - ### Method Detail

    - #### @Override protected CopyAction createCopyAction()

    - #### protected ZipCompressor getCompressor()

    - #### public ZipEntryCompression getEntryCompression()

      Returns the compression level of the entries of the archive. If set to ZipEntryCompression.DEFLATED (the default), each entry is compressed using the DEFLATE algorithm. If set to ZipEntryCompression.STORED the entries of the archive are left uncompressed.

      Returns:
        the compression level of the archive contents.

    - #### @Incubating public boolean isZip64()

      Whether the zip can contain more than 65535 files and/or support files greater than 4GB in size.

      The standard zip format has hard limits on file size and count. The Zip64 format extension practically removes these limits and is therefore required for building large zips.

      However, not all Zip readers support the Zip64 extensions. Notably, the ZipInputStream JDK class does not support Zip64 for versions earlier than Java 7. This means you should not enable this property if you are building JARs to be used with Java 6 and earlier runtimes.

    - #### public void setEntryCompression(ZipEntryCompression entryCompression)

      Sets the compression level of the entries of the archive. If set to ZipEntryCompression.DEFLATED (the default), each entry is compressed using the DEFLATE algorithm. If set to ZipEntryCompression.STORED the entries of the archive are left uncompressed.

      Parameters:
        `entryCompression` - `STORED` or `DEFLATED`

    - #### @Incubating public void setZip64(boolean allowZip64)

      Enables building zips with more than 65535 files or bigger than 4GB.

      See Also:
        isZip64()