Package jadex.publishservicejetty.impl
Class JarAsDirectory
java.lang.Object
java.io.File
jadex.publishservicejetty.impl.JarAsDirectory
- All Implemented Interfaces:
Serializable
,Comparable<File>
A directory-like representation of a jar file.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Boolean
protected File[]
The subentries contained in the entry.protected ZipEntry
The entry.protected Map
<String, JarAsDirectory> The files for the entry paths (cached for easy access).protected String
protected String
The path of the jar file.protected long
The timestamp of the file.protected boolean
The refresh flag (normally only for root jar file but in remote case also for entries (partial jars).Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
-
Constructor Summary
ConstructorsConstructorDescriptionJarAsDirectory
(String jarpath) Create a directory representation of a jar file.JarAsDirectory
(String jarpath, String entrystr, boolean dir, boolean refresh) Create a directory representation of a jar file entry.JarAsDirectory
(String jarpath, ZipEntry entry) Create a directory representation of a jar file entry. -
Method Summary
Modifier and TypeMethodDescriptionFile[]
createFiles
(String key, jadex.collection.MultiCollection<String, ZipEntry> entries) Create the files for an entry.boolean
exists()
Check if the file exists.Get the entryfiles.Get a file for an entry path.Get the path to the jar file.long
Get the lastmodified.Get the zip entry, if any (file pointer inside jar file).boolean
protected boolean
Test if jar should refresh its content.boolean
isRoot()
Test if this is the real jar (not a contained file).long
long
length()
File[]
File[]
listFiles
(FileFilter filter) File[]
listFiles
(FilenameFilter filter) boolean
refresh()
Refresh the jar entries.Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, getAbsoluteFile, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isFile, isHidden, list, list, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
-
Field Details
-
jarpath
The path of the jar file. -
lastmodified
protected long lastmodifiedThe timestamp of the file. -
entry
The entry. -
entrystr
-
dir
-
entries
The subentries contained in the entry. -
entryfiles
The files for the entry paths (cached for easy access). -
refresh
protected boolean refreshThe refresh flag (normally only for root jar file but in remote case also for entries (partial jars).
-
-
Constructor Details
-
JarAsDirectory
Create a directory representation of a jar file. -
JarAsDirectory
Create a directory representation of a jar file entry. -
JarAsDirectory
Create a directory representation of a jar file entry.
-
-
Method Details
-
isDirectory
public boolean isDirectory()- Overrides:
isDirectory
in classFile
-
listFiles
-
listFiles
-
listFiles
-
getAbsolutePath
- Overrides:
getAbsolutePath
in classFile
-
lastModified
public long lastModified()- Overrides:
lastModified
in classFile
-
length
public long length() -
refresh
public boolean refresh()Refresh the jar entries. -
createEntries
-
exists
public boolean exists()Check if the file exists. -
createFiles
Create the files for an entry. Recursive implementation for directory entries. -
getJarPath
Get the path to the jar file. -
getZipEntry
Get the zip entry, if any (file pointer inside jar file). The jar file itself (root) has no entry (i.e. entry=null). -
getFile
Get a file for an entry path. -
getEntryFiles
Get the entryfiles.- Returns:
- the entryfiles.
-
isRoot
public boolean isRoot()Test if this is the real jar (not a contained file). -
getLastModified
public long getLastModified()Get the lastmodified.- Returns:
- the lastmodified.
-
getEntryName
-
isRefresh
protected boolean isRefresh()Test if jar should refresh its content. Normally only root jar reads entries and entries already contain their children.
-