Class JarAsDirectory

java.lang.Object
java.io.File
jadex.publishservicejetty.impl.JarAsDirectory
All Implemented Interfaces:
Serializable, Comparable<File>

public class JarAsDirectory extends File
A directory-like representation of a jar file.
See Also:
  • Field Details

    • jarpath

      protected String jarpath
      The path of the jar file.
    • lastmodified

      protected long lastmodified
      The timestamp of the file.
    • entry

      protected ZipEntry entry
      The entry.
    • entrystr

      protected String entrystr
    • dir

      protected Boolean dir
    • entries

      protected File[] entries
      The subentries contained in the entry.
    • entryfiles

      protected Map<String,JarAsDirectory> entryfiles
      The files for the entry paths (cached for easy access).
    • refresh

      protected boolean refresh
      The refresh flag (normally only for root jar file but in remote case also for entries (partial jars).
  • Constructor Details

    • JarAsDirectory

      public JarAsDirectory(String jarpath)
      Create a directory representation of a jar file.
    • JarAsDirectory

      public JarAsDirectory(String jarpath, String entrystr, boolean dir, boolean refresh)
      Create a directory representation of a jar file entry.
    • JarAsDirectory

      public JarAsDirectory(String jarpath, ZipEntry entry)
      Create a directory representation of a jar file entry.
  • Method Details

    • isDirectory

      public boolean isDirectory()
      Overrides:
      isDirectory in class File
    • listFiles

      public File[] listFiles(FileFilter filter)
      Overrides:
      listFiles in class File
    • listFiles

      public File[] listFiles(FilenameFilter filter)
      Overrides:
      listFiles in class File
    • listFiles

      public File[] listFiles()
      Overrides:
      listFiles in class File
    • getAbsolutePath

      public String getAbsolutePath()
      Overrides:
      getAbsolutePath in class File
    • lastModified

      public long lastModified()
      Overrides:
      lastModified in class File
    • length

      public long length()
      Overrides:
      length in class File
    • refresh

      public boolean refresh()
      Refresh the jar entries.
    • createEntries

      public jadex.collection.MultiCollection<String,ZipEntry> createEntries()
    • exists

      public boolean exists()
      Check if the file exists.
      Overrides:
      exists in class File
    • createFiles

      public File[] createFiles(String key, jadex.collection.MultiCollection<String,ZipEntry> entries)
      Create the files for an entry. Recursive implementation for directory entries.
    • getJarPath

      public String getJarPath()
      Get the path to the jar file.
    • getZipEntry

      public 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).
    • getFile

      public File getFile(String path)
      Get a file for an entry path.
    • getEntryFiles

      public Map<String,JarAsDirectory> 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

      public String getEntryName()
    • isRefresh

      protected boolean isRefresh()
      Test if jar should refresh its content. Normally only root jar reads entries and entries already contain their children.