FileDocCategorySizeDatePackage
Pack200.javaAPI DocAndroid 1.5 API12708Wed May 06 22:41:02 BST 2009java.util.jar

Pack200

public abstract class Pack200 extends Object
Class factory for {@link Pack200.Packer} and {@link Pack200.Unpacker}.
since
Android 1.0

Fields Summary
private static final String
SYSTEM_PROPERTY_PACKER
private static final String
SYSTEM_PROPERTY_UNPACKER
Constructors Summary
private Pack200()
Prevent this class from being instantiated.

 //$NON-NLS-1$

               
     
        //do nothing
    
Methods Summary
public static java.util.jar.Pack200$PackernewPacker()
Returns a new instance of a packer engine.

The implementation of the packer engine is defined by the system property {@code '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.

return
an instance of {@code Packer}
since
Android 1.0

        return (Packer) AccessController
                .doPrivileged(new PrivilegedAction<Object>() {
                    public Object run() {
                        String className = System
                                .getProperty(SYSTEM_PROPERTY_PACKER,
                                        "org.apache.harmony.archive.internal.pack200.Pack200PackerAdapter"); //$NON-NLS-1$
                        try {
                            // TODO Not sure if this will cause problems with
                            // loading the packer
                            return ClassLoader.getSystemClassLoader()
                                    .loadClass(className).newInstance();
                        } catch (Exception e) {
                            throw new Error("Can't load class " + className, e);
                        }
                    }
                });

    
public static java.util.jar.Pack200$UnpackernewUnpacker()
Returns a new instance of a unpacker engine.

The implementation of the unpacker engine is defined by the system property {@code 'java.util.jar.Pack200.Unpacker'}. If this system property is defined an instance of the specified class is returned, otherwise the system's default implementation is returned.

return
a instance of {@code Unpacker}.
since
Android 1.0

        return (Unpacker) AccessController
                .doPrivileged(new PrivilegedAction<Object>() {
                    public Object run() {
                        String className = System
                                .getProperty(SYSTEM_PROPERTY_UNPACKER,
                                        "org.apache.harmony.archive.internal.pack200.Pack200UnpackerAdapter");//$NON-NLS-1$
                        try {
                            return ClassLoader.getSystemClassLoader()
                                    .loadClass(className).newInstance();
                        } catch (Exception e) {
                            throw new Error("Can't load class " + className, e);
                        }
                    }
                });