Package jadex.base
Class JarAsDirectory
- java.lang.Object
- 
- java.io.File
- 
- jadex.base.JarAsDirectory
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Comparable<java.io.File>
 
 public class JarAsDirectory extends java.io.FileA directory-like representation of a jar file.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.Booleandirprotected java.io.File[]entriesThe subentries contained in the entry.protected java.util.zip.ZipEntryentryThe entry.protected java.util.Map<java.lang.String,JarAsDirectory>entryfilesThe files for the entry paths (cached for easy access).protected java.lang.Stringentrystrprotected java.lang.StringjarpathThe path of the jar file.protected longlastmodifiedThe timestamp of the file.protected booleanrefreshThe refresh flag (normally only for root jar file but in remote case also for entries (partial jars).
 - 
Constructor SummaryConstructors Constructor Description JarAsDirectory(java.lang.String jarpath)Create a directory representation of a jar file.JarAsDirectory(java.lang.String jarpath, java.lang.String entrystr, boolean dir, boolean refresh)Create a directory representation of a jar file entry.JarAsDirectory(java.lang.String jarpath, java.util.zip.ZipEntry entry)Create a directory representation of a jar file entry.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCollection<java.lang.String,java.util.zip.ZipEntry>createEntries()java.io.File[]createFiles(java.lang.String key, MultiCollection<java.lang.String,java.util.zip.ZipEntry> entries)Create the files for an entry.booleanexists()Check if the file exists.java.lang.StringgetAbsolutePath()java.util.Map<java.lang.String,JarAsDirectory>getEntryFiles()Get the entryfiles.java.lang.StringgetEntryName()java.io.FilegetFile(java.lang.String path)Get a file for an entry path.java.lang.StringgetJarPath()Get the path to the jar file.longgetLastModified()Get the lastmodified.java.util.zip.ZipEntrygetZipEntry()Get the zip entry, if any (file pointer inside jar file).booleanisDirectory()protected booleanisRefresh()Test if jar should refresh its content.booleanisRoot()Test if this is the real jar (not a contained file).longlastModified()java.io.File[]listFiles()java.io.File[]listFiles(java.io.FileFilter filter)java.io.File[]listFiles(java.io.FilenameFilter filter)booleanrefresh()Refresh the jar entries.- 
Methods inherited from class java.io.FilecanExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, getAbsoluteFile, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isFile, isHidden, length, list, list, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
 
- 
 
- 
- 
- 
Field Detail- 
jarpathprotected java.lang.String jarpath The path of the jar file.
 - 
lastmodifiedprotected long lastmodified The timestamp of the file.
 - 
entryprotected java.util.zip.ZipEntry entry The entry.
 - 
entrystrprotected java.lang.String entrystr 
 - 
dirprotected java.lang.Boolean dir 
 - 
entriesprotected java.io.File[] entries The subentries contained in the entry.
 - 
entryfilesprotected java.util.Map<java.lang.String,JarAsDirectory> entryfiles The files for the entry paths (cached for easy access).
 - 
refreshprotected boolean refresh The refresh flag (normally only for root jar file but in remote case also for entries (partial jars).
 
- 
 - 
Constructor Detail- 
JarAsDirectorypublic JarAsDirectory(java.lang.String jarpath) Create a directory representation of a jar file.
 - 
JarAsDirectorypublic JarAsDirectory(java.lang.String jarpath, java.lang.String entrystr, boolean dir, boolean refresh)Create a directory representation of a jar file entry.
 - 
JarAsDirectorypublic JarAsDirectory(java.lang.String jarpath, java.util.zip.ZipEntry entry)Create a directory representation of a jar file entry.
 
- 
 - 
Method Detail- 
isDirectorypublic boolean isDirectory() - Overrides:
- isDirectoryin class- java.io.File
 
 - 
listFilespublic java.io.File[] listFiles(java.io.FileFilter filter) - Overrides:
- listFilesin class- java.io.File
 
 - 
listFilespublic java.io.File[] listFiles(java.io.FilenameFilter filter) - Overrides:
- listFilesin class- java.io.File
 
 - 
listFilespublic java.io.File[] listFiles() - Overrides:
- listFilesin class- java.io.File
 
 - 
getAbsolutePathpublic java.lang.String getAbsolutePath() - Overrides:
- getAbsolutePathin class- java.io.File
 
 - 
lastModifiedpublic long lastModified() - Overrides:
- lastModifiedin class- java.io.File
 
 - 
refreshpublic boolean refresh() Refresh the jar entries.
 - 
createEntriespublic MultiCollection<java.lang.String,java.util.zip.ZipEntry> createEntries() 
 - 
existspublic boolean exists() Check if the file exists.- Overrides:
- existsin class- java.io.File
 
 - 
createFilespublic java.io.File[] createFiles(java.lang.String key, MultiCollection<java.lang.String,java.util.zip.ZipEntry> entries)Create the files for an entry. Recursive implementation for directory entries.
 - 
getJarPathpublic java.lang.String getJarPath() Get the path to the jar file.
 - 
getZipEntrypublic java.util.zip.ZipEntry getZipEntry() Get the zip entry, if any (file pointer inside jar file). The jar file itself (root) has no entry (i.e. entry=null).
 - 
getFilepublic java.io.File getFile(java.lang.String path) Get a file for an entry path.
 - 
getEntryFilespublic java.util.Map<java.lang.String,JarAsDirectory> getEntryFiles() Get the entryfiles.- Returns:
- the entryfiles.
 
 - 
isRootpublic boolean isRoot() Test if this is the real jar (not a contained file).
 - 
getLastModifiedpublic long getLastModified() Get the lastmodified.- Returns:
- the lastmodified.
 
 - 
getEntryNamepublic java.lang.String getEntryName() 
 - 
isRefreshprotected boolean isRefresh() Test if jar should refresh its content. Normally only root jar reads entries and entries already contain their children.
 
- 
 
-