Class DirectoryInsideJarURLArchive
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.deployment.ArchiveBase
-
- org.eclipse.persistence.internal.jpa.deployment.DirectoryInsideJarURLArchive
-
- All Implemented Interfaces:
Archive
public class DirectoryInsideJarURLArchive extends ArchiveBase implements Archive
This is an implementation ofArchive
which is used when container returns a jar: URL. e.g. jar:file:/tmp/a_ear/b.war!/WEB-INF/classes/- Author:
- [email protected]
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.internal.jpa.deployment.ArchiveBase
descriptorLocation, rootURL
-
-
Constructor Summary
Constructors Constructor Description DirectoryInsideJarURLArchive(URL url, String descriptorLocation)
DirectoryInsideJarURLArchive(URL url, String descriptorLocation, Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close this archive and associated InputStream.Iterator<String>
getEntries()
Returns anIterator
of the file entries.InputStream
getEntry(String entryPath)
Returns the InputStream for the given entry name.URL
getEntryAsURL(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
-
DirectoryInsideJarURLArchive
public DirectoryInsideJarURLArchive(URL url, String descriptorLocation) throws IOException
- Throws:
IOException
-
DirectoryInsideJarURLArchive
public DirectoryInsideJarURLArchive(URL url, String descriptorLocation, Logger logger) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getEntries
public Iterator<String> getEntries()
Description copied from interface:Archive
Returns anIterator
of the file entries. Each String represents a file name relative to the root of the module.- Specified by:
getEntries
in interfaceArchive
-
getEntry
public InputStream getEntry(String entryPath) throws IOException
Description copied from interface:Archive
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.- Specified by:
getEntry
in interfaceArchive
- Specified by:
getEntry
in 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:Archive
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.- Specified by:
getEntryAsURL
in 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
-
-