org.h2.store.fs
Class FilePathRec

java.lang.Object
  extended by org.h2.store.fs.FilePath
      extended by org.h2.store.fs.FilePathWrapper
          extended by org.h2.store.fs.FilePathRec

public class FilePathRec
extends FilePathWrapper

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


Field Summary
 
Fields inherited from class org.h2.store.fs.FilePath
name
 
Constructor Summary
FilePathRec()
           
 
Method Summary
 boolean createFile()
          Create a new file.
 FilePath createTempFile(java.lang.String suffix, boolean deleteOnExit, boolean inTempDir)
          Create a new temporary file.
 void delete()
          Delete a file or directory if it exists.
 java.lang.String getScheme()
          Get the prefix for this file system.
 boolean isTrace()
           
 void moveTo(FilePath newPath)
          Rename a file if this is allowed.
 java.io.OutputStream newOutputStream(boolean append)
          Create an output stream to write into the file.
 java.nio.channels.FileChannel open(java.lang.String mode)
          Open a random access file object.
static void register()
          Register the file system.
static void setRecorder(Recorder recorder)
          Set the recorder class.
 void setTrace(boolean trace)
           
 
Methods inherited from class org.h2.store.fs.FilePathWrapper
canWrite, createDirectory, exists, getBase, getParent, getPath, getPrefix, isAbsolute, isDirectory, lastModified, newDirectoryStream, newInputStream, setReadOnly, size, toRealPath, unwrap, unwrap, wrap
 
Methods inherited from class org.h2.store.fs.FilePath
get, getName, getNextTempFileNamePart, register, toString, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilePathRec

public FilePathRec()
Method Detail

register

public static void register()
Register the file system.


setRecorder

public static void setRecorder(Recorder recorder)
Set the recorder class.

Parameters:
recorder - the recorder

createFile

public boolean createFile()
Description copied from class: FilePath
Create a new file.

Overrides:
createFile in class FilePathWrapper
Returns:
true if creating was successful

createTempFile

public FilePath createTempFile(java.lang.String suffix,
                               boolean deleteOnExit,
                               boolean inTempDir)
                        throws java.io.IOException
Description copied from class: FilePath
Create a new temporary file.

Overrides:
createTempFile in class FilePathWrapper
Parameters:
suffix - the suffix
deleteOnExit - if the file should be deleted when the virtual machine exists
inTempDir - if the file should be stored in the temporary directory
Returns:
the name of the created file
Throws:
java.io.IOException

delete

public void delete()
Description copied from class: FilePath
Delete a file or directory if it exists. Directories may only be deleted if they are empty.

Overrides:
delete in class FilePathWrapper

open

public java.nio.channels.FileChannel open(java.lang.String mode)
                                   throws java.io.IOException
Description copied from class: FilePath
Open a random access file object.

Overrides:
open in class FilePathWrapper
Parameters:
mode - the access mode. Supported are r, rw, rws, rwd
Returns:
the file object
Throws:
java.io.IOException

newOutputStream

public java.io.OutputStream newOutputStream(boolean append)
Description copied from class: FilePath
Create an output stream to write into the file.

Overrides:
newOutputStream in class FilePathWrapper
Parameters:
append - if true, the file will grow, if false, the file will be truncated first
Returns:
the output stream

moveTo

public void moveTo(FilePath newPath)
Description copied from class: FilePath
Rename a file if this is allowed.

Overrides:
moveTo in class FilePathWrapper
Parameters:
newPath - the new fully qualified file name

isTrace

public boolean isTrace()

setTrace

public void setTrace(boolean trace)

getScheme

public java.lang.String getScheme()
Get the prefix for this file system.

Specified by:
getScheme in class FilePath
Returns:
the prefix