- All Known Implementing Classes:
DirectoryArchive
,DirectoryInsideJarURLArchive
,InMemoryArchive
,JarFileArchive
,JarInputStreamURLArchive
,URLArchive
public interface Archive
Provides an abstraction to deal with various kinds of URLs that can
be returned by
PersistenceUnitInfo.getPersistenceUnitRootUrl()
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this archive and associated InputStream.Returns anIterator
of the file entries.Returns the InputStream for the given entry name.getEntryAsURL
(String entryPath) Returns the URL for the given entry name.
-
Method Details
-
getEntries
Returns anIterator
of the file entries. Each String represents a file name relative to the root of the module. -
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
- 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
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
- Returns:
- an input stream on the persistence descriptor.
- Throws:
IOException
-
close
void close()Close this archive and associated InputStream.
-