Top Description Inners Fields Constructors Methods
org.apache.commons.compress.java.util.jar

public abstract Class Pack200

extends Object
Class Inheritance
Imports
java.beans.PropertyChangeListener, java.io.File, .IOException, .InputStream, .OutputStream, java.security.AccessController, .PrivilegedAction, java.util.Objects, .SortedMap, java.util.jar.JarFile, .JarInputStream, .JarOutputStream, org.apache.commons.compress.harmony.archive.internal.nls.Messages, org.apache.commons.io.input.BoundedInputStream

Class factory for Pack200.Packer and Pack200.Unpacker.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Pack200.Packer

The interface defining the API for converting a JAR file to an output stream in the Pack200 format.

public static interface
Pack200.Unpacker

The interface defining the API for converting a packed stream in the Pack200 format to a JAR file.

Field Summary

Modifier and TypeField and Description
private static final String
SYSTEM_PROPERTY_PACKER

System property key.

private static final String
SYSTEM_PROPERTY_UNPACKER

System property key.

Constructor Summary

AccessConstructor and Description
private
Pack200()

Prevents this class from being instantiated.

Method Summary

Modifier and TypeMethod and Description
pack-priv static Object
newInstance(final String systemProperty, final String defaultClassName)

public static Pack200.Packer

Returns:

an instance of Packer
newPacker
()

Returns a new instance of a packer engine.

public static Pack200.Unpacker

Returns:

an instance of Pack200.Unpacker.
newUnpacker
()

Returns a new instance of an unpacker engine.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

SYSTEM_PROPERTY_PACKERback to summary
private static final String SYSTEM_PROPERTY_PACKER

System property key.

SYSTEM_PROPERTY_UNPACKERback to summary
private static final String SYSTEM_PROPERTY_UNPACKER

System property key.

Constructor Detail

Pack200back to summary
private Pack200()

Prevents this class from being instantiated.

Method Detail

newInstanceback to summary
pack-priv static Object newInstance(final String systemProperty, final String defaultClassName)
newPackerback to summary
public static Pack200.Packer newPacker()

Returns a new instance of a packer engine.

The implementation of the packer engine is defined by the system property 'java.util.jar.Pack200.Packer'. If this system property is defined an instance of the specified class is returned, otherwise the system's default implementation is returned.

Returns:Pack200.Packer

an instance of Packer

newUnpackerback to summary
public static Pack200.Unpacker newUnpacker()

Returns a new instance of an unpacker engine.

The implementation of the unpacker engine is defined by the system property Pack200.Unpacker. If this system property is defined an instance of the specified class is returned, otherwise the system's default implementation is returned.

Returns:Pack200.Unpacker

an instance of Pack200.Unpacker.

org.apache.commons.compress.java.util.jar back to summary

public Interface Pack200.Packer

Known Direct Implementers
org.apache.commons.compress.harmony.pack200.Pack200PackerAdapter

The interface defining the API for converting a JAR file to an output stream in the Pack200 format.

Field Summary

Modifier and TypeField and Description
public static final String
CLASS_ATTRIBUTE_PFX

The format of a class attribute name.

public static final String
CODE_ATTRIBUTE_PFX

The format of a code attribute name.

public static final String
DEFLATE_HINT

The deflation hint to set in the output archive.

public static final String
EFFORT

The indicated amount of effort to use in compressing the archive.

public static final String
ERROR

a String representation for error.

public static final String
FALSE

a String representation of false.

public static final String
FIELD_ATTRIBUTE_PFX

The format of a field attribute name.

public static final String
KEEP

The String representation for keep.

public static final String
KEEP_FILE_ORDER

Decide if all elements shall transmit in their original order.

public static final String
LATEST

The String representation for latest.

public static final String
METHOD_ATTRIBUTE_PFX

The format of a method attribute name.

public static final String
MODIFICATION_TIME

If it shall attempt to determine the latest modification time if this is set to LATEST.

public static final String
PASS

The String representation of pass.

public static final String
PASS_FILE_PFX

The file that will not be compressed.

public static final String
PROGRESS

Packer progress as a percentage.

public static final String
SEGMENT_LIMIT

The number of bytes of each archive segment.

public static final String
STRIP

The String representation of strip.

public static final String
TRUE

The String representation of true.

public static final String
UNKNOWN_ATTRIBUTE

The action to take if an unknown attribute is encountered.

Method Summary

Modifier and TypeMethod and Description
public void
addPropertyChangeListener(PropertyChangeListener
the listener to listen if PropertyChange events occurs
listener
)

Adds a listener for PropertyChange events

public void
pack(JarFile
JAR file to be compressed.
in
,
OutputStream
stream of compressed data.
out
)

Packs the specified JAR file to the specified output stream.

public void
pack(JarInputStream
stream of uncompressed JAR data.
in
,
OutputStream
stream of compressed data.
out
)

Packs the data from the specified jar input stream to the specified output stream.

public SortedMap<String, String>

Returns:

the properties of the packer.
properties
()

Gets a sorted map of the properties of this packer.

public void
removePropertyChangeListener(PropertyChangeListener
listener to remove
listener
)

Removes a listener

Field Detail

CLASS_ATTRIBUTE_PFXback to summary
public static final String CLASS_ATTRIBUTE_PFX

The format of a class attribute name.

CODE_ATTRIBUTE_PFXback to summary
public static final String CODE_ATTRIBUTE_PFX

The format of a code attribute name.

DEFLATE_HINTback to summary
public static final String DEFLATE_HINT

The deflation hint to set in the output archive.

EFFORTback to summary
public static final String EFFORT

The indicated amount of effort to use in compressing the archive.

ERRORback to summary
public static final String ERROR

a String representation for error.

FALSEback to summary
public static final String FALSE

a String representation of false.

FIELD_ATTRIBUTE_PFXback to summary
public static final String FIELD_ATTRIBUTE_PFX

The format of a field attribute name.

KEEPback to summary
public static final String KEEP

The String representation for keep.

KEEP_FILE_ORDERback to summary
public static final String KEEP_FILE_ORDER

Decide if all elements shall transmit in their original order.

LATESTback to summary
public static final String LATEST

The String representation for latest.

METHOD_ATTRIBUTE_PFXback to summary
public static final String METHOD_ATTRIBUTE_PFX

The format of a method attribute name.

MODIFICATION_TIMEback to summary
public static final String MODIFICATION_TIME

If it shall attempt to determine the latest modification time if this is set to LATEST.

PASSback to summary
public static final String PASS

The String representation of pass.

PASS_FILE_PFXback to summary
public static final String PASS_FILE_PFX

The file that will not be compressed.

PROGRESSback to summary
public static final String PROGRESS

Packer progress as a percentage.

SEGMENT_LIMITback to summary
public static final String SEGMENT_LIMIT

The number of bytes of each archive segment.

STRIPback to summary
public static final String STRIP

The String representation of strip.

TRUEback to summary
public static final String TRUE

The String representation of true.

UNKNOWN_ATTRIBUTEback to summary
public static final String UNKNOWN_ATTRIBUTE

The action to take if an unknown attribute is encountered.

Method Detail

addPropertyChangeListenerback to summary
public void addPropertyChangeListener(PropertyChangeListener listener)

Adds a listener for PropertyChange events

Parameters
listener:PropertyChangeListener

the listener to listen if PropertyChange events occurs

packback to summary
public void pack(JarFile in, OutputStream out) throws IOException

Packs the specified JAR file to the specified output stream.

Parameters
in:JarFile

JAR file to be compressed.

out:OutputStream

stream of compressed data.

Exceptions
IOException:
if I/O exception occurs.
packback to summary
public void pack(JarInputStream in, OutputStream out) throws IOException

Packs the data from the specified jar input stream to the specified output stream.

Parameters
in:JarInputStream

stream of uncompressed JAR data.

out:OutputStream

stream of compressed data.

Exceptions
IOException:
if I/O exception occurs.
propertiesback to summary
public SortedMap<String, String> properties()

Gets a sorted map of the properties of this packer.

Returns:SortedMap<String, String>

the properties of the packer.

removePropertyChangeListenerback to summary
public void removePropertyChangeListener(PropertyChangeListener listener)

Removes a listener

Parameters
listener:PropertyChangeListener

listener to remove

org.apache.commons.compress.java.util.jar back to summary

public Interface Pack200.Unpacker

Known Direct Implementers
org.apache.commons.compress.harmony.unpack200.Pack200UnpackerAdapter

The interface defining the API for converting a packed stream in the Pack200 format to a JAR file.

Field Summary

Modifier and TypeField and Description
public static final String
DEFLATE_HINT

The String indicating if the unpacker should ignore all transmitted values, can be replaced by either true or false.

public static final String
FALSE

a String representation of false.

public static final String
KEEP

a String representation of keep.

public static final String
PROGRESS

The progress as a percentage.

public static final String
TRUE

a String representation of true.

Method Summary

Modifier and TypeMethod and Description
public void
addPropertyChangeListener(PropertyChangeListener
the listener to listen if PropertyChange events occurs.
listener
)

Adds a listener for PropertyChange events.

public SortedMap<String, String>

Returns:

the properties of unpacker.
properties
()

Gets a sorted map of the properties of this unpacker.

public void
removePropertyChangeListener(PropertyChangeListener
listener to remove.
listener
)

Removes a listener.

public void
unpack(File
file to uncompress.
in
,
JarOutputStream
JAR output stream of uncompressed data.
out
)

Unpacks the contents of the specified File to the specified JAR output stream.

public void
unpack(InputStream
stream to uncompress, preferably a BoundedInputStream.
in
,
JarOutputStream
JAR output stream of uncompressed data.
out
)

Unpacks the specified stream to the specified JAR output stream.

Field Detail

DEFLATE_HINTback to summary
public static final String DEFLATE_HINT

The String indicating if the unpacker should ignore all transmitted values, can be replaced by either true or false.

FALSEback to summary
public static final String FALSE

a String representation of false.

KEEPback to summary
public static final String KEEP

a String representation of keep.

PROGRESSback to summary
public static final String PROGRESS

The progress as a percentage.

TRUEback to summary
public static final String TRUE

a String representation of true.

Method Detail

addPropertyChangeListenerback to summary
public void addPropertyChangeListener(PropertyChangeListener listener)

Adds a listener for PropertyChange events.

Parameters
listener:PropertyChangeListener

the listener to listen if PropertyChange events occurs.

propertiesback to summary
public SortedMap<String, String> properties()

Gets a sorted map of the properties of this unpacker.

Returns:SortedMap<String, String>

the properties of unpacker.

removePropertyChangeListenerback to summary
public void removePropertyChangeListener(PropertyChangeListener listener)

Removes a listener.

Parameters
listener:PropertyChangeListener

listener to remove.

unpackback to summary
public void unpack(File in, JarOutputStream out) throws IOException

Unpacks the contents of the specified File to the specified JAR output stream.

Parameters
in:File

file to uncompress.

out:JarOutputStream

JAR output stream of uncompressed data.

Exceptions
IOException:
if I/O exception occurs.
unpackback to summary
public void unpack(InputStream in, JarOutputStream out) throws IOException

Unpacks the specified stream to the specified JAR output stream.

Parameters
in:InputStream

stream to uncompress, preferably a BoundedInputStream.

out:JarOutputStream

JAR output stream of uncompressed data.

Exceptions
IOException:
if I/O exception occurs.