Top Description Fields Constructors Methods
org.apache.derby.impl.io

pack-priv Class CPFile

extends InputStreamFile<CPStorageFactory>
Class Inheritance
Imports
org.apache.derby.io.StorageFile, java.io.InputStream, .FileNotFoundException, java.net.URL

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.

Field Summary

Inherited from org.apache.derby.impl.io.InputStreamFile:
nameStartpathstorageFactory

Constructor Summary

AccessConstructor and Description
pack-priv
CPFile(CPStorageFactory storageFactory, String path)

pack-priv
CPFile(CPStorageFactory storageFactory, String parent, String name)

pack-priv
CPFile(CPFile dir, String name)

private
CPFile(CPStorageFactory storageFactory, String child, int pathLen)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the named file exists, false if not.
exists
()

Implements abstract org.apache.derby.impl.io.InputStreamFile.exists.

Implements org.apache.derby.io.StorageFile.exists.

Tests whether the named file exists.

private static ClassLoader
public InputStream

Returns:

an input stream suitable for reading from the file.
getInputStream
()

Implements abstract org.apache.derby.impl.io.InputStreamFile.getInputStream.

Implements org.apache.derby.io.StorageFile.getInputStream.

Creates an input stream from a file name.

pack-priv StorageFile
getParentDir(int
the length of the parent's path name.
pathLen
)

Implements abstract org.apache.derby.impl.io.InputStreamFile.getParentDir.

Get the parent of this file.

private static URL
getResource(final ClassLoader cl, final String name)

This used to be a Privileged wrapper for ClassLoader.getResource(String).

private static InputStream
getResourceAsStream(final ClassLoader cl, final String name)

This used to be a Privileged wrapper for ClassLoader.getResourceAsStream(String).

private static URL
getSystemResource(final String name)

This used to be a Privileged wrapper for ClassLoader.getSystemResource(String).

private static InputStream
getSystemResourceAsStream(final String name)

This used to be a Privileged wrapper for ClassLoader.getSystemResourceAsStream(String).

private URL
getURL()

Return a URL for this file (resource).

Inherited from org.apache.derby.impl.io.InputStreamFile:
canWritecreateNewFiledeletedeleteAllequalsgetCanonicalPathgetExclusiveFileLockgetNamegetOutputStreamgetOutputStreamgetParentDirgetPathgetRandomAccessFilehashCodeisDirectorylimitAccessToOwnerlistmkdirmkdirsreleaseExclusiveFileLockrenameTosetReadOnlytoString

Constructor Detail

CPFileback to summary
pack-priv CPFile(CPStorageFactory storageFactory, String path)
CPFileback to summary
pack-priv CPFile(CPStorageFactory storageFactory, String parent, String name)
CPFileback to summary
pack-priv CPFile(CPFile dir, String name)
CPFileback to summary
private CPFile(CPStorageFactory storageFactory, String child, int pathLen)

Method Detail

existsback to summary
public boolean exists()

Implements abstract org.apache.derby.impl.io.InputStreamFile.exists.

Implements org.apache.derby.io.StorageFile.exists.

Tests whether the named file exists.

Returns:boolean

true if the named file exists, false if not.

getContextClassLoaderback to summary
private static ClassLoader getContextClassLoader(final Thread thread)
getInputStreamback to summary
public InputStream getInputStream() throws FileNotFoundException

Implements abstract org.apache.derby.impl.io.InputStreamFile.getInputStream.

Implements org.apache.derby.io.StorageFile.getInputStream.

Creates an input stream from a file name.

Returns:InputStream

an input stream suitable for reading from the file.

Exceptions
FileNotFoundException:
if the file is not found.
getParentDirback to summary
pack-priv StorageFile getParentDir(int pathLen)

Implements abstract org.apache.derby.impl.io.InputStreamFile.getParentDir.

Get the parent of this file.

Parameters
pathLen:int

the length of the parent's path name.

getResourceback to summary
private static URL getResource(final ClassLoader cl, final String name)

This used to be a Privileged wrapper for ClassLoader.getResource(String).

getResourceAsStreamback to summary
private static InputStream getResourceAsStream(final ClassLoader cl, final String name)

This used to be a Privileged wrapper for ClassLoader.getResourceAsStream(String).

getSystemResourceback to summary
private static URL getSystemResource(final String name)

This used to be a Privileged wrapper for ClassLoader.getSystemResource(String).

getSystemResourceAsStreamback to summary
private static InputStream getSystemResourceAsStream(final String name)

This used to be a Privileged wrapper for ClassLoader.getSystemResourceAsStream(String).

getURLback to summary
private URL getURL()

Return a URL for this file (resource).