Package org.apache.derby.impl.io
Class JarDBFile
- All Implemented Interfaces:
StorageFile
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.
-
Field Summary
Fields inherited from class org.apache.derby.impl.io.InputStreamFile
nameStart, path, storageFactory
Fields inherited from interface org.apache.derby.io.StorageFile
EXCLUSIVE_FILE_LOCK, EXCLUSIVE_FILE_LOCK_NOT_AVAILABLE, NO_FILE_LOCK_SUPPORT
-
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
(package private)
JarDBFile
(JarStorageFactory storageFactory, String path) private
JarDBFile
(JarStorageFactory storageFactory, String child, int pathLen) (package private)
JarDBFile
(JarStorageFactory storageFactory, String parent, String name) -
Method Summary
Modifier and TypeMethodDescriptionboolean
exists()
Tests whether the named file exists.private ZipEntry
getEntry()
Creates an input stream from a file name.(package private) StorageFile
getParentDir
(int pathLen) Get the name of the parent directory if this name includes a parent.toString()
Get the file name for diagnostic purposes.Methods inherited from class org.apache.derby.impl.io.InputStreamFile
canWrite, createNewFile, delete, deleteAll, equals, getCanonicalPath, getExclusiveFileLock, getName, getOutputStream, getOutputStream, getParentDir, getPath, getRandomAccessFile, hashCode, isDirectory, limitAccessToOwner, list, mkdir, mkdirs, releaseExclusiveFileLock, renameTo, setReadOnly
-
Constructor Details
-
JarDBFile
JarDBFile(JarStorageFactory storageFactory, String path) -
JarDBFile
JarDBFile(JarStorageFactory storageFactory, String parent, String name) -
JarDBFile
-
JarDBFile
-
-
Method Details
-
exists
public boolean exists()Tests whether the named file exists.- Specified by:
exists
in interfaceStorageFile
- Specified by:
exists
in classInputStreamFile<JarStorageFactory>
- Returns:
- true if the named file exists, false if not.
-
getEntry
-
getParentDir
Get the name of the parent directory if this name includes a parent.- Specified by:
getParentDir
in classInputStreamFile<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
Creates an input stream from a file name.- Specified by:
getInputStream
in interfaceStorageFile
- Specified by:
getInputStream
in classInputStreamFile<JarStorageFactory>
- Returns:
- an input stream suitable for reading from the file.
- Throws:
FileNotFoundException
- if the file is not found.
-
toString
Get the file name for diagnostic purposes. Usually the same as getPath().- Overrides:
toString
in classInputStreamFile<JarStorageFactory>
- Returns:
- the file name
-