org.h2.store.fs
Class FileSystemSplit

java.lang.Object
  extended by org.h2.store.fs.FileSystem
      extended by org.h2.store.fs.FileSystemWrapper
          extended by org.h2.store.fs.FileSystemSplit

public class FileSystemSplit
extends FileSystemWrapper

A file system that may split files into multiple smaller files. (required for a FAT32 because it only support files up to 2 GB).


Field Summary
static java.lang.String PREFIX
          The prefix to use for this file system.
 
Constructor Summary
FileSystemSplit()
           
 
Method Summary
 void copy(java.lang.String source, java.lang.String target)
          Copy a file from one directory to another, or to another file.
 void delete(java.lang.String fileName)
          Delete a file.
 long getLastModified(java.lang.String fileName)
          Get the last modified date of a file
protected  java.lang.String getPrefix()
          Get the prefix for this file system.
 long length(java.lang.String fileName)
          Get the length of a file.
 java.lang.String[] listFiles(java.lang.String directory)
          List the files in the given directory.
 java.io.InputStream openFileInputStream(java.lang.String fileName)
          Create an input stream to read from the file.
 FileObject openFileObject(java.lang.String fileName, java.lang.String mode)
          Open a random access file object.
 java.io.OutputStream openFileOutputStream(java.lang.String fileName, boolean append)
          Create an output stream to write into the file.
 void rename(java.lang.String oldName, java.lang.String newName)
          Rename a file if this is allowed.
 boolean setReadOnly(java.lang.String fileName)
          Disable the ability to write.
 boolean tryDelete(java.lang.String fileName)
          Try to delete a file.
 java.lang.String unwrap(java.lang.String fileName)
          Get the unwrapped file name (without wrapper prefixes if wrapping / delegating file systems are used).
 
Methods inherited from class org.h2.store.fs.FileSystemWrapper
accepts, canWrite, createDirs, createNewFile, createTempFile, deleteRecursive, exists, fileStartsWith, getCanonicalPath, getFileName, getParent, isAbsolute, isDirectory, isReadOnly
 
Methods inherited from class org.h2.store.fs.FileSystem
getInstance, getNextTempFileNamePart, mkdirs, register, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX

public static final java.lang.String PREFIX
The prefix to use for this file system.

See Also:
Constant Field Values
Constructor Detail

FileSystemSplit

public FileSystemSplit()
Method Detail

setReadOnly

public boolean setReadOnly(java.lang.String fileName)
Description copied from class: FileSystem
Disable the ability to write.

Overrides:
setReadOnly in class FileSystemWrapper
Parameters:
fileName - the file name
Returns:
true if the call was successful

copy

public void copy(java.lang.String source,
                 java.lang.String target)
Description copied from class: FileSystem
Copy a file from one directory to another, or to another file.

Overrides:
copy in class FileSystemWrapper
Parameters:
source - the name of the original file
target - the file name of the copy

delete

public void delete(java.lang.String fileName)
Description copied from class: FileSystem
Delete a file.

Overrides:
delete in class FileSystemWrapper
Parameters:
fileName - the file name

getLastModified

public long getLastModified(java.lang.String fileName)
Description copied from class: FileSystem
Get the last modified date of a file

Overrides:
getLastModified in class FileSystemWrapper
Parameters:
fileName - the file name
Returns:
the last modified date

length

public long length(java.lang.String fileName)
Description copied from class: FileSystem
Get the length of a file.

Overrides:
length in class FileSystemWrapper
Parameters:
fileName - the file name
Returns:
the length in bytes

listFiles

public java.lang.String[] listFiles(java.lang.String directory)
Description copied from class: FileSystem
List the files in the given directory.

Overrides:
listFiles in class FileSystemWrapper
Parameters:
directory - the directory
Returns:
the list of fully qualified file names

openFileInputStream

public java.io.InputStream openFileInputStream(java.lang.String fileName)
                                        throws java.io.IOException
Description copied from class: FileSystem
Create an input stream to read from the file.

Overrides:
openFileInputStream in class FileSystemWrapper
Parameters:
fileName - the file name
Returns:
the input stream
Throws:
java.io.IOException

openFileObject

public FileObject openFileObject(java.lang.String fileName,
                                 java.lang.String mode)
                          throws java.io.IOException
Description copied from class: FileSystem
Open a random access file object.

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

openFileOutputStream

public java.io.OutputStream openFileOutputStream(java.lang.String fileName,
                                                 boolean append)
Description copied from class: FileSystem
Create an output stream to write into the file.

Overrides:
openFileOutputStream in class FileSystemWrapper
Parameters:
fileName - the file name
append - if true, the file will grow, if false, the file will be truncated first
Returns:
the output stream

rename

public void rename(java.lang.String oldName,
                   java.lang.String newName)
Description copied from class: FileSystem
Rename a file if this is allowed.

Overrides:
rename in class FileSystemWrapper
Parameters:
oldName - the old fully qualified file name
newName - the new fully qualified file name

tryDelete

public boolean tryDelete(java.lang.String fileName)
Description copied from class: FileSystem
Try to delete a file.

Overrides:
tryDelete in class FileSystemWrapper
Parameters:
fileName - the file name
Returns:
true if it could be deleted

unwrap

public java.lang.String unwrap(java.lang.String fileName)
Description copied from class: FileSystem
Get the unwrapped file name (without wrapper prefixes if wrapping / delegating file systems are used).

Overrides:
unwrap in class FileSystemWrapper
Parameters:
fileName - the file name
Returns:
the unwrapped

getPrefix

protected java.lang.String getPrefix()
Description copied from class: FileSystemWrapper
Get the prefix for this file system.

Specified by:
getPrefix in class FileSystemWrapper
Returns:
the prefix