@Service(name="http") @PerLookup public class HTTPInputArchive extends AbstractReadableArchive
Although the JARs are stored as JARs in the Java Web Start cache, Java Web Start hides the actual location where the cached JAR resides. So this implementation does not rely on the JARs location but uses URLs to access the archive itself and its elements.
archiveMetaData, extraData, parentArchive
Constructor and Description |
---|
HTTPInputArchive() |
Modifier and Type | Method and Description |
---|---|
void |
close()
closes this archive and releases all resources
|
boolean |
delete()
deletes the archive
|
Enumeration<String> |
entries()
Returns an enumeration of the module file entries.
|
Enumeration<String> |
entries(String prefix)
Returns an enumeration of the module file entries with the
specified prefix.
|
boolean |
exists() |
boolean |
exists(String name)
Returns the existence of the given entry name
The file name must be relative to the root of the module.
|
long |
getArchiveSize()
Returns the size of the archive.
|
Collection<String> |
getDirectories()
Returns the enumeration of first level directories in this
archive
|
InputStream |
getEntry(String name)
Returns the InputStream for the given entry name
The file name must be relative to the root of the module.
|
long |
getEntrySize(String name)
Returns the entry size for a given entry name or 0 if not known
|
Manifest |
getManifest()
Returns the manifest information for this archive
|
String |
getName()
Returns the name of the archive.
|
ReadableArchive |
getSubArchive(String name)
Returns an instance of this archive abstraction for an embedded
archive within this archive.
|
URI |
getURI()
Returns the path used to create or open the underlying archive
|
boolean |
isDirectory(String name)
Returns true if the entry is a directory or a plain file
|
void |
open(URI uri)
Open an abstract archive
|
boolean |
renameTo(String name)
rename the archive
|
addArchiveMetaData, getArchiveMetaData, getExtraData, getParentArchive, removeArchiveMetaData, removeExtraData, setExtraData, setParentArchive
public InputStream getEntry(String name) throws IOException
ReadableArchive
name
- the file name relative to the root of the module.IOException
public boolean exists(String name) throws IOException
ReadableArchive
name
- the file name relative to the root of the module.IOException
public long getEntrySize(String name)
ReadableArchive
name
- the entry namepublic void open(URI uri) throws IOException
ReadableArchive
uri
- path to the archiveIOException
public ReadableArchive getSubArchive(String name) throws IOException
ReadableArchive
name
- is the entry name relative to the root for the archiveIOException
public boolean exists()
public boolean delete()
ReadableArchive
public boolean renameTo(String name)
ReadableArchive
name
- the archive namepublic void close() throws IOException
Archive
IOException
public Enumeration<String> entries()
Archive
public Enumeration<String> entries(String prefix)
Archive
prefix
- the prefix of entries to be includedpublic Collection<String> getDirectories() throws IOException
Archive
IOException
public boolean isDirectory(String name)
Archive
name
- name is one of the entries returned by Archive.entries()
public Manifest getManifest() throws IOException
Archive
IOException
public URI getURI()
Archive
TODO: abstraction breakage:
Several callers, most notably DeploymentContext.getSourceDir()
implementation, assumes that this URI is an URL, and in fact file URL.
If this needs to be URL, use of URI
is misleading. And furthermore,
if its needs to be a file URL, this should be File
.
public long getArchiveSize() throws SecurityException
Archive
SecurityException
Copyright © 2018. All rights reserved.