Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.deployment

public Class JarFileArchive

extends ArchiveBase
implements Archive
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.jpa.Archive
Imports
java.util.jar.JarFile, .JarEntry, java.util.Iterator, .Enumeration, .ArrayList, java.util.logging.Logger, .Level, java.util.zip.ZipEntry, java.io.InputStream, .IOException, .File, java.net.URL, .MalformedURLException, org.eclipse.persistence.jpa.Archive

This is an implementation of Archive when container returns a file: url that refers to a jar file. e.g. file:/tmp/a_ear/lib/pu.jar
Author
[email protected]

Field Summary

Modifier and TypeField and Description
private JarFile
private Logger
Inherited from org.eclipse.persistence.internal.jpa.deployment.ArchiveBase:
descriptorLocationrootURL

Constructor Summary

AccessConstructor and Description
public
JarFileArchive(URL rootUrl, JarFile jarFile, String descriptorLocation)

public
JarFileArchive(URL rootUrl, JarFile jarFile, String descriptorLocation, Logger logger)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements org.eclipse.persistence.jpa.Archive.close.

Close this archive and associated InputStream.
public Iterator<String>
public InputStream
getEntry(String
the file name relative to the root of the module.
entryPath
)

Implements abstract org.eclipse.persistence.internal.jpa.deployment.ArchiveBase.getEntry.

Implements org.eclipse.persistence.jpa.Archive.getEntry.

Returns the InputStream for the given entry name.
public URL
getEntryAsURL(String
the file name relative to the root of the module.
entryPath
)

Implements org.eclipse.persistence.jpa.Archive.getEntryAsURL.

Returns the URL for the given entry name.
Inherited from org.eclipse.persistence.internal.jpa.deployment.ArchiveBase:
getDescriptorLocationgetDescriptorStreamgetRootURLsetDescriptorLocationsetRootURLtoString

Field Detail

jarFileback to summary
private JarFile jarFile
loggerback to summary
private Logger logger
Annotations
@SuppressWarnings:unused

Constructor Detail

JarFileArchiveback to summary
public JarFileArchive(URL rootUrl, JarFile jarFile, String descriptorLocation) throws MalformedURLException
Annotations
@SuppressWarnings:deprecation
JarFileArchiveback to summary
public JarFileArchive(URL rootUrl, JarFile jarFile, String descriptorLocation, Logger logger) throws MalformedURLException

Method Detail

closeback to summary
public void close()

Implements org.eclipse.persistence.jpa.Archive.close.

Doc from org.eclipse.persistence.jpa.Archive.close.

Close this archive and associated InputStream.

Annotations
@Override
getEntriesback to summary
public Iterator<String> getEntries()

Implements org.eclipse.persistence.jpa.Archive.getEntries.

Doc from org.eclipse.persistence.jpa.Archive.getEntries.

Returns an java.util.Iterator of the file entries. Each String represents a file name relative to the root of the module.

Annotations
@Override
getEntryback to summary
public InputStream getEntry(String entryPath) throws IOException

Implements abstract org.eclipse.persistence.internal.jpa.deployment.ArchiveBase.getEntry.

Implements org.eclipse.persistence.jpa.Archive.getEntry.

Doc from org.eclipse.persistence.jpa.Archive.getEntry.

Returns the InputStream for the given entry name. Returns null if no such entry exists. The entry name must be relative to the root of the module.

Parameters
entryPath:String

the file name relative to the root of the module.

Returns:InputStream

the InputStream for the given entry name or null if not found.

Annotations
@Override
getEntryAsURLback to summary
public URL getEntryAsURL(String entryPath) throws IOException

Implements org.eclipse.persistence.jpa.Archive.getEntryAsURL.

Doc from org.eclipse.persistence.jpa.Archive.getEntryAsURL.

Returns the URL for the given entry name. Returns null if no such entry exists. The entry name must be relative to the root of the module.

Parameters
entryPath:String

the file name relative to the root of the module.

Returns:URL

the URL for the given entry name or null if not found.

Annotations
@Override