Module org.eclipse.persistence.jpa
Class JarInputStreamURLArchive
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.deployment.ArchiveBase
-
- org.eclipse.persistence.internal.jpa.deployment.JarInputStreamURLArchive
-
- All Implemented Interfaces:
Archive
public class JarInputStreamURLArchive extends ArchiveBase implements Archive
This is an implementation ofArchivewhich is used when container returns some form of URL from which an InputStream in jar format can be obtained. e.g. jar:file:/tmp/a_ear/b.war!/WEB-INF/lib/pu.jar- Author:
- Sanjeeb.Sahoo@Sun.COM
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.internal.jpa.deployment.ArchiveBase
descriptorLocation, rootURL
-
-
Constructor Summary
Constructors Constructor Description JarInputStreamURLArchive(URL url, String descriptorLocation)JarInputStreamURLArchive(URL url, String descriptorLocation, Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close this archive and associated InputStream.Iterator<String>getEntries()Returns anIteratorof the file entries.InputStreamgetEntry(String entryPath)Returns the InputStream for the given entry name.URLgetEntryAsURL(String entryPath)Returns the URL for the given entry name.-
Methods inherited from class org.eclipse.persistence.internal.jpa.deployment.ArchiveBase
getDescriptorLocation, getDescriptorStream, getRootURL, setDescriptorLocation, setRootURL, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.jpa.Archive
getDescriptorStream, getRootURL
-
-
-
-
Constructor Detail
-
JarInputStreamURLArchive
public JarInputStreamURLArchive(URL url, String descriptorLocation) throws IOException
- Throws:
IOException
-
JarInputStreamURLArchive
public JarInputStreamURLArchive(URL url, String descriptorLocation, Logger logger) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getEntries
public Iterator<String> getEntries()
Description copied from interface:ArchiveReturns anIteratorof the file entries. Each String represents a file name relative to the root of the module.- Specified by:
getEntriesin interfaceArchive
-
getEntry
public InputStream getEntry(String entryPath) throws IOException
Description copied from interface:ArchiveReturns 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.- Specified by:
getEntryin interfaceArchive- Specified by:
getEntryin classArchiveBase- Parameters:
entryPath- the file name relative to the root of the module.- Returns:
- the InputStream for the given entry name or null if not found.
- Throws:
IOException
-
getEntryAsURL
public URL getEntryAsURL(String entryPath) throws IOException
Description copied from interface:ArchiveReturns 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.- Specified by:
getEntryAsURLin interfaceArchive- Parameters:
entryPath- the file name relative to the root of the module.- Returns:
- the URL for the given entry name or null if not found.
- Throws:
IOException
-
-