Class JarDBFile

  • All Implemented Interfaces:
    StorageFile

    class JarDBFile
    extends InputStreamFile<JarStorageFactory>
    This class provides a jar file based implementation of the StorageFile interface. It is used by the database engine to access persistent data and transaction logs under the jar subsubprotocol.
    • Constructor Detail

      • JarDBFile

        JarDBFile​(JarStorageFactory storageFactory,
                  java.lang.String parent,
                  java.lang.String name)
      • JarDBFile

        JarDBFile​(JarDBFile dir,
                  java.lang.String name)
      • JarDBFile

        private JarDBFile​(JarStorageFactory storageFactory,
                          java.lang.String child,
                          int pathLen)
    • Method Detail

      • getEntry

        private java.util.zip.ZipEntry getEntry()
      • getParentDir

        StorageFile getParentDir​(int pathLen)
        Get the name of the parent directory if this name includes a parent.
        Specified by:
        getParentDir in class InputStreamFile<JarStorageFactory>
        Parameters:
        pathLen - the length of the parent's path name.
        Returns:
        An StorageFile denoting the parent directory of this StorageFile, if it has a parent, null if it does not have a parent.
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.FileNotFoundException
        Creates an input stream from a file name.
        Specified by:
        getInputStream in interface StorageFile
        Specified by:
        getInputStream in class InputStreamFile<JarStorageFactory>
        Returns:
        an input stream suitable for reading from the file.
        Throws:
        java.io.FileNotFoundException - if the file is not found.
      • toString

        public java.lang.String toString()
        Get the file name for diagnostic purposes. Usually the same as getPath().
        Overrides:
        toString in class InputStreamFile<JarStorageFactory>
        Returns:
        the file name