public class JarScriptArchive extends java.lang.Object implements ScriptArchive
JarFile
.
The jar file may optionally contain a module specification. If it does, then the module specification
is deserialized and used to construct the archive. Otherwise, a module specification with default values
is created.Modifier and Type | Class and Description |
---|---|
static class |
JarScriptArchive.Builder
Used to Construct a
JarScriptArchive . |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_MODULE_SPEC_FILE_NAME
Default file name of the optional
ScriptModuleSpec in the archive |
Modifier | Constructor and Description |
---|---|
protected |
JarScriptArchive(ScriptModuleSpec moduleSpec,
java.nio.file.Path jarPath,
long createTime) |
protected |
JarScriptArchive(ScriptModuleSpec moduleSpec,
java.nio.file.Path jarPath,
java.lang.String moduleSpecEntry,
long createTime) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.Set<java.lang.String> |
getArchiveEntryNames() |
long |
getCreateTime()
Timestamp used to resolve multiple revisions of the archive.
|
java.net.URL |
getEntry(java.lang.String entryName) |
ScriptModuleSpec |
getModuleSpec() |
java.net.URL |
getRootUrl()
Gets the root path in the form of 'file://path/to/jarfile/jarfile.jar".
|
int |
hashCode() |
void |
setModuleSpec(ScriptModuleSpec spec)
Set the module spec for this archive.
|
java.lang.String |
toString() |
public static final java.lang.String DEFAULT_MODULE_SPEC_FILE_NAME
ScriptModuleSpec
in the archiveprotected JarScriptArchive(ScriptModuleSpec moduleSpec, java.nio.file.Path jarPath, long createTime) throws java.io.IOException
java.io.IOException
protected JarScriptArchive(ScriptModuleSpec moduleSpec, java.nio.file.Path jarPath, java.lang.String moduleSpecEntry, long createTime) throws java.io.IOException
java.io.IOException
public ScriptModuleSpec getModuleSpec()
getModuleSpec
in interface ScriptArchive
public void setModuleSpec(ScriptModuleSpec spec)
ScriptArchive
setModuleSpec
in interface ScriptArchive
spec
- the module spec to set to.public java.net.URL getRootUrl()
getRootUrl
in interface ScriptArchive
URL
s representing the contents of this archive. should be
suitable for passing to a URLClassLoader
public java.util.Set<java.lang.String> getArchiveEntryNames()
getArchiveEntryNames
in interface ScriptArchive
@Nullable public java.net.URL getEntry(java.lang.String entryName) throws java.io.IOException
getEntry
in interface ScriptArchive
java.io.IOException
public long getCreateTime()
ScriptArchive
getCreateTime
in interface ScriptArchive
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object