Class Jar

    • Field Detail

      • DEFAULT_EXTENSION

        public static final java.lang.String DEFAULT_EXTENSION
        See Also:
        Constant Field Values
    • Constructor Detail

      • Jar

        public Jar()
    • Method Detail

      • getMetadataCharset

        public java.lang.String getMetadataCharset()
        The character set used to encode JAR metadata like file names. Defaults to UTF-8. You can change this property but it is not recommended as JVMs expect JAR metadata to be encoded using UTF-8
        Overrides:
        getMetadataCharset in class Zip
        Returns:
        the character set used to encode JAR metadata like file names
        Since:
        2.14
      • setMetadataCharset

        public void setMetadataCharset​(java.lang.String metadataCharset)
        The character set used to encode JAR metadata like file names. Defaults to UTF-8. You can change this property but it is not recommended as JVMs expect JAR metadata to be encoded using UTF-8
        Overrides:
        setMetadataCharset in class Zip
        Parameters:
        metadataCharset - the character set used to encode JAR metadata like file names
        Since:
        2.14
      • getManifestContentCharset

        @Input
        public java.lang.String getManifestContentCharset()
        The character set used to encode the manifest content. Defaults to UTF-8. You can change this property but it is not recommended as JVMs expect manifests content to be encoded using UTF-8.
        Returns:
        the character set used to encode the manifest content
        Since:
        2.14
      • setManifestContentCharset

        public void setManifestContentCharset​(java.lang.String manifestContentCharset)
        The character set used to encode the manifest content.
        Parameters:
        manifestContentCharset - the character set used to encode the manifest content
        Since:
        2.14
        See Also:
        getManifestContentCharset()
      • getManifest

        @Internal
        public Manifest getManifest()
        Returns the manifest for this JAR archive.
        Returns:
        The manifest
      • setManifest

        public void setManifest​(Manifest manifest)
        Sets the manifest for this JAR archive.
        Parameters:
        manifest - The manifest. May be null.
      • manifest

        public Jar manifest​(@DelegatesTo(Manifest.class)
                            Closure<?> configureClosure)
        Configures the manifest for this JAR archive.

        The given closure is executed to configure the manifest. The Manifest is passed to the closure as its delegate.

        Parameters:
        configureClosure - The closure.
        Returns:
        This.
      • manifest

        public Jar manifest​(Action<? super Manifest> configureAction)
        Configures the manifest for this JAR archive.

        The given action is executed to configure the manifest.

        Parameters:
        configureAction - The action.
        Returns:
        This.
        Since:
        3.5
      • metaInf

        public CopySpec metaInf​(@DelegatesTo(CopySpec.class)
                                Closure<?> configureClosure)
        Adds content to this JAR archive's META-INF directory.

        The given closure is executed to configure a CopySpec. The CopySpec is passed to the closure as its delegate.

        Parameters:
        configureClosure - The closure.
        Returns:
        The created CopySpec
      • metaInf

        public CopySpec metaInf​(Action<? super CopySpec> configureAction)
        Adds content to this JAR archive's META-INF directory.

        The given action is executed to configure a CopySpec.

        Parameters:
        configureAction - The action.
        Returns:
        The created CopySpec
        Since:
        3.5