org.apache.derby.impl.io
Class CPFile
java.lang.Object
org.apache.derby.impl.io.InputStreamFile
org.apache.derby.impl.io.CPFile
- All Implemented Interfaces:
- StorageFile
class CPFile
- extends InputStreamFile
This class provides a class path based implementation of the StorageFile interface. It is used by the
database engine to access persistent data and transaction logs under the classpath subsubprotocol.
Method Summary |
boolean |
exists()
Tests whether the named file exists. |
java.io.InputStream |
getInputStream()
Creates an input stream from a file name. |
(package private) StorageFile |
getParentDir(int pathLen)
Get the parent of this file. |
java.net.URL |
getURL()
Return a URL for this file (resource). |
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, length, list, mkdir, mkdirs, releaseExclusiveFileLock, renameTo, setReadOnly, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
storageFactory
private final CPStorageFactory storageFactory
CPFile
CPFile(CPStorageFactory storageFactory,
java.lang.String path)
CPFile
CPFile(CPStorageFactory storageFactory,
java.lang.String parent,
java.lang.String name)
CPFile
CPFile(CPFile dir,
java.lang.String name)
CPFile
private CPFile(CPStorageFactory storageFactory,
java.lang.String child,
int pathLen)
exists
public boolean exists()
- Tests whether the named file exists.
- Specified by:
exists
in interface StorageFile
- Specified by:
exists
in class InputStreamFile
- Returns:
- true if the named file exists, false if not.
getParentDir
StorageFile getParentDir(int pathLen)
- Get the parent of this file.
- Specified by:
getParentDir
in class InputStreamFile
- Parameters:
pathLen
- the length of the parent's path name.
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
- Returns:
- an input stream suitable for reading from the file.
- Throws:
java.io.FileNotFoundException
- if the file is not found.
getURL
public java.net.URL getURL()
- Return a URL for this file (resource).
- Specified by:
getURL
in interface StorageFile
- Overrides:
getURL
in class InputStreamFile
- See Also:
StorageFile.getURL()
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.