Top Description Fields Constructors Methods
org.h2.store.fs.rec

public Class FilePathRec

extends FilePathWrapper
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.nio.channels.FileChannel, org.h2.store.fs.FilePath, .FilePathWrapper, .Recorder

A file system that records all write operations and can re-play them.

Field Summary

Modifier and TypeField and Description
private static final FilePathRec
private static Recorder
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public FilePath
createTempFile(String
the suffix
suffix
,
boolean
if the file should be stored in the temporary directory
inTempDir
)

Overrides org.h2.store.fs.FilePathWrapper.createTempFile.

Create a new temporary file.

public void
delete()

Overrides org.h2.store.fs.FilePathWrapper.delete.

Delete a file or directory if it exists.

public String

Returns:

the prefix
getScheme
()

Implements abstract org.h2.store.fs.FilePath.getScheme.

Get the prefix for this file system.

public boolean
pack-priv void
log(int
the operation
op
,
String
the file name(s)
fileName
)

Log the operation.

pack-priv void
log(int
the operation
op
,
String
the file name
fileName
,
byte[]
the data or null
data
,
long
the value or 0
x
)

Log the operation.

public void
moveTo(FilePath
the new fully qualified file name
newPath
,
boolean
whether the move should be atomic, and the target file should be replaced if it exists and replacing is possible
atomicReplace
)

Overrides org.h2.store.fs.FilePathWrapper.moveTo.

Rename a file if this is allowed.

public OutputStream
newOutputStream(boolean
if true, the file will grow, if false, the file will be truncated first
append
)

Overrides org.h2.store.fs.FilePathWrapper.newOutputStream.

Create an output stream to write into the file.

public FileChannel
open(String
the access mode. Supported are r, rw, rws, rwd
mode
)

Overrides org.h2.store.fs.FilePathWrapper.open.

Open a random access file object.

public static void
register()

Register the file system.

public static void
setRecorder(Recorder
the recorder
recorder
)

Set the recorder class.

public void
setTrace(boolean trace)

Inherited from org.h2.store.fs.FilePathWrapper:
canWritecreateDirectoryexistsgetBasegetParentgetPathgetPrefixisAbsoluteisDirectoryisRegularFilelastModifiednewDirectoryStreamnewInputStreamsetReadOnlysizetoRealPathunwrapunwrapwrap

Field Detail

INSTANCEback to summary
private static final FilePathRec INSTANCE
recorderback to summary
private static Recorder recorder
traceback to summary
private boolean trace

Constructor Detail

FilePathRecback to summary
public FilePathRec()

Method Detail

createFileback to summary
public boolean createFile()

Overrides org.h2.store.fs.FilePathWrapper.createFile.

Doc from org.h2.store.fs.FilePath.createFile.

Create a new file.

Returns:boolean

true if creating was successful

Annotations
@Override
createTempFileback to summary
public FilePath createTempFile(String suffix, boolean inTempDir) throws IOException

Overrides org.h2.store.fs.FilePathWrapper.createTempFile.

Doc from org.h2.store.fs.FilePath.createTempFile.

Create a new temporary file.

Parameters
suffix:String

the suffix

inTempDir:boolean

if the file should be stored in the temporary directory

Returns:FilePath

the name of the created file

Annotations
@Override
Exceptions
IOException:
on failure
deleteback to summary
public void delete()

Overrides org.h2.store.fs.FilePathWrapper.delete.

Doc from org.h2.store.fs.FilePath.delete.

Delete a file or directory if it exists. Directories may only be deleted if they are empty.

Annotations
@Override
getSchemeback to summary
public String getScheme()

Implements abstract org.h2.store.fs.FilePath.getScheme.

Get the prefix for this file system.

Returns:String

the prefix

Annotations
@Override
isTraceback to summary
public boolean isTrace()
logback to summary
pack-priv void log(int op, String fileName)

Log the operation.

Parameters
op:int

the operation

fileName:String

the file name(s)

logback to summary
pack-priv void log(int op, String fileName, byte[] data, long x)

Log the operation.

Parameters
op:int

the operation

fileName:String

the file name

data:byte[]

the data or null

x:long

the value or 0

moveToback to summary
public void moveTo(FilePath newPath, boolean atomicReplace)

Overrides org.h2.store.fs.FilePathWrapper.moveTo.

Doc from org.h2.store.fs.FilePath.moveTo.

Rename a file if this is allowed.

Parameters
newPath:FilePath

the new fully qualified file name

atomicReplace:boolean

whether the move should be atomic, and the target file should be replaced if it exists and replacing is possible

Annotations
@Override
newOutputStreamback to summary
public OutputStream newOutputStream(boolean append) throws IOException

Overrides org.h2.store.fs.FilePathWrapper.newOutputStream.

Doc from org.h2.store.fs.FilePath.newOutputStream.

Create an output stream to write into the file.

Parameters
append:boolean

if true, the file will grow, if false, the file will be truncated first

Returns:OutputStream

the output stream

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
openback to summary
public FileChannel open(String mode) throws IOException

Overrides org.h2.store.fs.FilePathWrapper.open.

Doc from org.h2.store.fs.FilePath.open.

Open a random access file object.

Parameters
mode:String

the access mode. Supported are r, rw, rws, rwd

Returns:FileChannel

the file object

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
registerback to summary
public static void register()

Register the file system.

setRecorderback to summary
public static void setRecorder(Recorder recorder)

Set the recorder class.

Parameters
recorder:Recorder

the recorder

setTraceback to summary
public void setTrace(boolean trace)