Top Description Inners Constructors Methods
com.sun.enterprise.module.common_impl

public abstract Class Jar

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.enterprise.module.common_impl.Jar.Directory, com.sun.enterprise.module.common_impl.Jar.Archive
Imports
java.io.DataInputStream, .File, .FileInputStream, .IOException, java.util.jar.JarFile, .Manifest, java.util.zip.ZipException, com.sun.enterprise.module.ModuleMetadata

Abstraction of JarFile so that we can handle both a jar file and a directory image transparently.
Author
Kohsuke Kawaguchi

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Constructor Summary

AccessConstructor and Description
protected
Jar()

Method Summary

Modifier and TypeMethod and Description
public static Jar
create(File file)

public abstract String
getBaseName()

Gets the base name of the jar.

public abstract Manifest
getManifest()

See JarFile#getManifest() for the contract.

public abstract void
loadMetadata(ModuleMetadata result)

Loads all META-INF/habitats entries and store them to the list.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Jarback to summary
protected Jar()

Method Detail

createback to summary
public static Jar create(File file) throws IOException
getBaseNameback to summary
public abstract String getBaseName()

Gets the base name of the jar.

For example, "bar" for "bar.jar".

getManifestback to summary
public abstract Manifest getManifest() throws IOException

See JarFile#getManifest() for the contract.

loadMetadataback to summary
public abstract void loadMetadata(ModuleMetadata result)

Loads all META-INF/habitats entries and store them to the list.

com.sun.enterprise.module.common_impl back to summary

private final Class Jar.Archive

extends Jar
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final File
private final JarFile

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getBaseName()

Implements abstract com.sun.enterprise.module.common_impl.Jar.getBaseName.

Gets the base name of the jar.

public Manifest
public void
loadMetadata(ModuleMetadata result)

Implements abstract com.sun.enterprise.module.common_impl.Jar.loadMetadata.

Loads all META-INF/habitats entries and store them to the list.

Inherited from com.sun.enterprise.module.common_impl.Jar:
create

Field Detail

fileback to summary
private final File file
jarback to summary
private final JarFile jar

Constructor Detail

Archiveback to summary
public Archive(File jar) throws IOException

Method Detail

getBaseNameback to summary
public String getBaseName()

Implements abstract com.sun.enterprise.module.common_impl.Jar.getBaseName.

Doc from com.sun.enterprise.module.common_impl.Jar.getBaseName.

Gets the base name of the jar.

For example, "bar" for "bar.jar".

getManifestback to summary
public Manifest getManifest() throws IOException

Implements abstract com.sun.enterprise.module.common_impl.Jar.getManifest.

Doc from com.sun.enterprise.module.common_impl.Jar.getManifest.

See JarFile#getManifest() for the contract.

loadMetadataback to summary
public void loadMetadata(ModuleMetadata result)

Implements abstract com.sun.enterprise.module.common_impl.Jar.loadMetadata.

Doc from com.sun.enterprise.module.common_impl.Jar.loadMetadata.

Loads all META-INF/habitats entries and store them to the list.

com.sun.enterprise.module.common_impl back to summary

private final Class Jar.Directory

extends Jar
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final File

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private File[]
public String
getBaseName()

Implements abstract com.sun.enterprise.module.common_impl.Jar.getBaseName.

Gets the base name of the jar.

public Manifest
public void
loadMetadata(ModuleMetadata result)

Implements abstract com.sun.enterprise.module.common_impl.Jar.loadMetadata.

Loads all META-INF/habitats entries and store them to the list.

private byte[]
Inherited from com.sun.enterprise.module.common_impl.Jar:
create

Field Detail

dirback to summary
private final File dir

Constructor Detail

Directoryback to summary
public Directory(File dir)

Method Detail

fixNullback to summary
private File[] fixNull(File[] f)
getBaseNameback to summary
public String getBaseName()

Implements abstract com.sun.enterprise.module.common_impl.Jar.getBaseName.

Doc from com.sun.enterprise.module.common_impl.Jar.getBaseName.

Gets the base name of the jar.

For example, "bar" for "bar.jar".

getManifestback to summary
public Manifest getManifest() throws IOException

Implements abstract com.sun.enterprise.module.common_impl.Jar.getManifest.

Doc from com.sun.enterprise.module.common_impl.Jar.getManifest.

See JarFile#getManifest() for the contract.

loadMetadataback to summary
public void loadMetadata(ModuleMetadata result)

Implements abstract com.sun.enterprise.module.common_impl.Jar.loadMetadata.

Doc from com.sun.enterprise.module.common_impl.Jar.loadMetadata.

Loads all META-INF/habitats entries and store them to the list.

readFullyback to summary
private byte[] readFully(File f) throws IOException