Top Description Constructors Methods
org.apache.commons.compress.compressors.pack200

public Class Pack200Utils

extends Object
Class Inheritance
Imports
java.io.File, .IOException, .OutputStream, java.nio.file.Files, .Path, java.util.HashMap, .Map, java.util.jar.JarFile, .JarOutputStream, org.apache.commons.compress.java.util.jar.Pack200

Utility methods for Pack200.
Since
1.3

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
normalize(final File
the JAR archive to normalize
jar
)

Normalizes a JAR archive in-place, so it can be safely signed and packed.

public static void
normalize(final File
the JAR archive to normalize
from
,
final File
the normalized archive
to
)

Normalizes a JAR archive, so it can be safely signed and packed.

public static void
normalize(final File
the JAR archive to normalize
from
,
final File
the normalized archive
to
,
Map<String, String>
properties to set for the pack operation. This method will implicitly set the segment limit to -1.
props
)

Normalizes a JAR archive, so it can be safely signed and packed.

public static void
normalize(final File
the JAR archive to normalize
jar
,
final Map<String, String>
properties to set for the pack operation. This method will implicitly set the segment limit to -1.
props
)

Normalizes a JAR archive in-place, so it can be safely signed and packed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Pack200Utilsback to summary
private Pack200Utils()

Method Detail

normalizeback to summary
public static void normalize(final File jar) throws IOException

Normalizes a JAR archive in-place, so it can be safely signed and packed.

As stated in Pack200.Packer's javadocs applying a Pack200 compression to a JAR archive will in general make its signatures invalid. In order to prepare a JAR for signing it should be "normalized" by packing and unpacking it. This is what this method does.

Note this methods implicitly sets the segment length to -1.

Parameters
jar:File

the JAR archive to normalize

Exceptions
IOException:
if reading or writing fails
normalizeback to summary
public static void normalize(final File from, final File to) throws IOException

Normalizes a JAR archive, so it can be safely signed and packed.

As stated in Pack200.Packer's javadocs applying a Pack200 compression to a JAR archive will in general make its signatures invalid. In order to prepare a JAR for signing it should be "normalized" by packing and unpacking it. This is what this method does.

This method does not replace the existing archive but creates a new one.

Note this methods implicitly sets the segment length to -1.

Parameters
from:File

the JAR archive to normalize

to:File

the normalized archive

Exceptions
IOException:
if reading or writing fails
normalizeback to summary
public static void normalize(final File from, final File to, Map<String, String> props) throws IOException

Normalizes a JAR archive, so it can be safely signed and packed.

As stated in Pack200.Packer's javadocs applying a Pack200 compression to a JAR archive will in general make its signatures invalid. In order to prepare a JAR for signing it should be "normalized" by packing and unpacking it. This is what this method does.

This method does not replace the existing archive but creates a new one.

Parameters
from:File

the JAR archive to normalize

to:File

the normalized archive

props:Map<String, String>

properties to set for the pack operation. This method will implicitly set the segment limit to -1.

Exceptions
IOException:
if reading or writing fails
normalizeback to summary
public static void normalize(final File jar, final Map<String, String> props) throws IOException

Normalizes a JAR archive in-place, so it can be safely signed and packed.

As stated in Pack200.Packer's javadocs applying a Pack200 compression to a JAR archive will in general make its signatures invalid. In order to prepare a JAR for signing it should be "normalized" by packing and unpacking it. This is what this method does.

Parameters
jar:File

the JAR archive to normalize

props:Map<String, String>

properties to set for the pack operation. This method will implicitly set the segment limit to -1.

Exceptions
IOException:
if reading or writing fails