-
- All Known Implementing Classes:
DirectoryArchive,DirectoryInsideJarURLArchive,JarFileArchive,JarInputStreamURLArchive,URLArchive
public interface ArchiveProvides an abstraction to deal with various kinds of URLs that can be returned byPersistenceUnitInfo.getPersistenceUnitRootUrl()- Author:
- Sanjeeb.Sahoo@Sun.COM
- See Also:
ArchiveFactoryImpl
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Close this archive and associated InputStream.InputStreamgetDescriptorStream()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.URLgetRootURL()
-
-
-
Method Detail
-
getEntries
Iterator<String> getEntries()
Returns anIteratorof the file entries. Each String represents a file name relative to the root of the module.
-
getEntry
InputStream getEntry(String entryPath) throws IOException
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- 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
URL getEntryAsURL(String entryPath) throws IOException
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- 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
-
getRootURL
URL getRootURL()
- Returns:
- the URL that this archive represents.
-
getDescriptorStream
InputStream getDescriptorStream() throws IOException
- Returns:
- an input stream on the persistence descriptor.
- Throws:
IOException
-
close
void close()
Close this archive and associated InputStream.
-
-