Package org.apache.derby.impl.io
Class JarDBFile
- java.lang.Object
-
- org.apache.derby.impl.io.InputStreamFile<JarStorageFactory>
-
- org.apache.derby.impl.io.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.
-
-
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
Constructors Modifier Constructor Description (package private)JarDBFile(JarDBFile dir, java.lang.String name)(package private)JarDBFile(JarStorageFactory storageFactory, java.lang.String path)privateJarDBFile(JarStorageFactory storageFactory, java.lang.String child, int pathLen)(package private)JarDBFile(JarStorageFactory storageFactory, java.lang.String parent, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists()Tests whether the named file exists.private java.util.zip.ZipEntrygetEntry()java.io.InputStreamgetInputStream()Creates an input stream from a file name.(package private) StorageFilegetParentDir(int pathLen)Get the name of the parent directory if this name includes a parent.java.lang.StringtoString()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 Detail
-
JarDBFile
JarDBFile(JarStorageFactory storageFactory, java.lang.String path)
-
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
-
exists
public boolean exists()
Tests whether the named file exists.- Specified by:
existsin interfaceStorageFile- Specified by:
existsin classInputStreamFile<JarStorageFactory>- Returns:
- true if the named file exists, false if not.
-
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:
getParentDirin 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
public java.io.InputStream getInputStream() throws java.io.FileNotFoundExceptionCreates an input stream from a file name.- Specified by:
getInputStreamin interfaceStorageFile- Specified by:
getInputStreamin classInputStreamFile<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:
toStringin classInputStreamFile<JarStorageFactory>- Returns:
- the file name
-
-