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

pack-priv Class DirRandomAccessFile

extends RandomAccessFile
implements StorageRandomAccessFile
Class Inheritance
All Implemented Interfaces
org.apache.derby.io.StorageRandomAccessFile, java.io.DataOutput, java.io.DataInput
Imports
org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.io.StorageFile, .StorageRandomAccessFile, java.io.File, .RandomAccessFile, .IOException, .FileNotFoundException

This class provides a disk based implementation of the StIRandomAccess File interface. It is used by the database engine to access persistent data and transaction logs under the directory (default) subsubprotocol.

Field Summary

Modifier and TypeField and Description
private final String
private final File

Constructor Summary

AccessConstructor and Description
pack-priv
DirRandomAccessFile(File
The file name.
name
,
String
The file open mode: "r", "rw", "rws", or "rwd". The "rws" and "rwd" modes specify that the file is to be synchronized, consistent with the java.io.RandomAccessFile class. However the StorageRandomAccessFile.sync() method will be called even if the file was opened in "rws" or "rwd" mode. If the "rws" or "rwd" modes are supported then the implementation of StorageRandomAccessFile.sync need not do anything.
mode
)

Construct a StorageRandomAccessFileImpl.

Method Summary

Modifier and TypeMethod and Description
public DirRandomAccessFile
clone()

Overrides java.lang.Object.clone.

Implements org.apache.derby.io.StorageRandomAccessFile.clone.

Clone this file abstaction

public void
sync()

Implements org.apache.derby.io.StorageRandomAccessFile.sync.

Force any changes out to the persistent store.

Inherited from java.io.RandomAccessFile:
closegetChannelgetFDgetFilePointerlengthreadreadreadreadBooleanreadBytereadCharreadDoublereadFloatreadFullyreadFullyreadIntreadLinereadLongreadShortreadUnsignedBytereadUnsignedShortreadUTFseeksetLengthskipByteswritewritewritewriteBooleanwriteBytewriteByteswriteCharwriteCharswriteDoublewriteFloatwriteIntwriteLongwriteShortwriteUTF

Field Detail

_modeback to summary
private final String _mode
_nameback to summary
private final File _name

Constructor Detail

DirRandomAccessFileback to summary
pack-priv DirRandomAccessFile(File name, String mode) throws FileNotFoundException

Construct a StorageRandomAccessFileImpl.

Parameters
name:File

The file name.

mode:String

The file open mode: "r", "rw", "rws", or "rwd". The "rws" and "rwd" modes specify that the file is to be synchronized, consistent with the java.io.RandomAccessFile class. However the StorageRandomAccessFile.sync() method will be called even if the file was opened in "rws" or "rwd" mode. If the "rws" or "rwd" modes are supported then the implementation of StorageRandomAccessFile.sync need not do anything.

Exceptions
FileNotFoundException:
if the file exists but is a directory rather than a regular file, or cannot be opened or created for any other reason .
IllegalArgumentException:
if the mode argument is not equal to one of "r", "rw".

Method Detail

cloneback to summary
public DirRandomAccessFile clone()

Overrides java.lang.Object.clone.

Implements org.apache.derby.io.StorageRandomAccessFile.clone.

Clone this file abstaction

Returns:DirRandomAccessFile

Doc from java.lang.Object.clone.

a clone of this instance.

syncback to summary
public void sync() throws IOException

Implements org.apache.derby.io.StorageRandomAccessFile.sync.

Force any changes out to the persistent store.

Exceptions
IOException:
If an IO error occurs.