|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.store.fs.FileSystem
org.h2.store.fs.FileSystemSplit
public class FileSystemSplit
A file system that may split files into multiple smaller files.
Field Summary |
---|
Fields inherited from class org.h2.store.fs.FileSystem |
---|
PREFIX_MEMORY, PREFIX_MEMORY_LZF, PREFIX_NIO, PREFIX_NIO_MAPPED, PREFIX_SPLIT, PREFIX_ZIP |
Constructor Summary | |
---|---|
FileSystemSplit()
|
Method Summary | |
---|---|
boolean |
canWrite(java.lang.String fileName)
Check if the file is writable. |
void |
copy(java.lang.String original,
java.lang.String copy)
Copy a file from one directory to another, or to another file. |
void |
createDirs(java.lang.String fileName)
Create all required directories that are required for this file. |
boolean |
createNewFile(java.lang.String fileName)
Create a new file. |
java.lang.String |
createTempFile(java.lang.String prefix,
java.lang.String suffix,
boolean deleteOnExit,
boolean inTempDir)
Create a new temporary file. |
void |
delete(java.lang.String fileName)
Delete a file. |
void |
deleteRecursive(java.lang.String directory,
boolean tryOnly)
Delete a directory or file and all subdirectories and files. |
boolean |
exists(java.lang.String fileName)
Checks if a file exists. |
boolean |
fileStartsWith(java.lang.String fileName,
java.lang.String prefix)
Check if a file starts with a given prefix. |
java.lang.String |
getAbsolutePath(java.lang.String fileName)
Get the absolute file name. |
java.lang.String |
getFileName(java.lang.String name)
Get the file name (without directory part). |
static FileSystemSplit |
getInstance()
|
long |
getLastModified(java.lang.String fileName)
Get the last modified date of a file |
java.lang.String |
getParent(java.lang.String fileName)
Get the parent directory of a file or directory. |
boolean |
isAbsolute(java.lang.String fileName)
Check if the file name includes a path. |
boolean |
isDirectory(java.lang.String fileName)
Check if it is a file or a directory. |
boolean |
isReadOnly(java.lang.String fileName)
Check if a file is read-only. |
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.lang.String |
normalize(java.lang.String fileName)
Normalize a file name. |
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 |
tryDelete(java.lang.String fileName)
Try to delete a file. |
Methods inherited from class org.h2.store.fs.FileSystem |
---|
accepts, getInstance, mkdirs, register, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileSystemSplit()
Method Detail |
---|
public static FileSystemSplit getInstance()
public boolean canWrite(java.lang.String fileName)
FileSystem
canWrite
in class FileSystem
fileName
- the file name
public void copy(java.lang.String original, java.lang.String copy) throws java.sql.SQLException
FileSystem
copy
in class FileSystem
original
- the original file namecopy
- the file name of the copy
java.sql.SQLException
public void createDirs(java.lang.String fileName) throws java.sql.SQLException
FileSystem
createDirs
in class FileSystem
fileName
- the file name (not directory name)
java.sql.SQLException
public boolean createNewFile(java.lang.String fileName) throws java.sql.SQLException
FileSystem
createNewFile
in class FileSystem
fileName
- the file name
java.sql.SQLException
public java.lang.String createTempFile(java.lang.String prefix, java.lang.String suffix, boolean deleteOnExit, boolean inTempDir) throws java.io.IOException
FileSystem
createTempFile
in class FileSystem
prefix
- the prefix of the file name (including directory name if
required)suffix
- the suffixdeleteOnExit
- if the file should be deleted when the virtual
machine existsinTempDir
- if the file should be stored in the temporary directory
java.io.IOException
public void delete(java.lang.String fileName) throws java.sql.SQLException
FileSystem
delete
in class FileSystem
fileName
- the file name
java.sql.SQLException
public void deleteRecursive(java.lang.String directory, boolean tryOnly) throws java.sql.SQLException
FileSystem
deleteRecursive
in class FileSystem
directory
- the directorytryOnly
- whether errors should be ignored
java.sql.SQLException
public boolean exists(java.lang.String fileName)
FileSystem
exists
in class FileSystem
fileName
- the file name
public boolean fileStartsWith(java.lang.String fileName, java.lang.String prefix)
FileSystem
fileStartsWith
in class FileSystem
fileName
- the complete file nameprefix
- the prefix
public java.lang.String getAbsolutePath(java.lang.String fileName)
FileSystem
getAbsolutePath
in class FileSystem
fileName
- the file name
public java.lang.String getFileName(java.lang.String name) throws java.sql.SQLException
FileSystem
getFileName
in class FileSystem
name
- the directory and file name
java.sql.SQLException
public long getLastModified(java.lang.String fileName)
FileSystem
getLastModified
in class FileSystem
fileName
- the file name
public java.lang.String getParent(java.lang.String fileName)
FileSystem
getParent
in class FileSystem
fileName
- the file or directory name
public boolean isAbsolute(java.lang.String fileName)
FileSystem
isAbsolute
in class FileSystem
fileName
- the file name
public boolean isDirectory(java.lang.String fileName)
FileSystem
isDirectory
in class FileSystem
fileName
- the file or directory name
public boolean isReadOnly(java.lang.String fileName)
FileSystem
isReadOnly
in class FileSystem
fileName
- the file name
public long length(java.lang.String fileName)
FileSystem
length
in class FileSystem
fileName
- the file name
public java.lang.String[] listFiles(java.lang.String directory) throws java.sql.SQLException
FileSystem
listFiles
in class FileSystem
directory
- the directory
java.sql.SQLException
public java.lang.String normalize(java.lang.String fileName) throws java.sql.SQLException
FileSystem
normalize
in class FileSystem
fileName
- the file name
java.sql.SQLException
public java.io.InputStream openFileInputStream(java.lang.String fileName) throws java.io.IOException
FileSystem
openFileInputStream
in class FileSystem
fileName
- the file name
java.io.IOException
public FileObject openFileObject(java.lang.String fileName, java.lang.String mode) throws java.io.IOException
FileSystem
openFileObject
in class FileSystem
fileName
- the file namemode
- the access mode. Supported are r, rw, rws, rwd
java.io.IOException
public java.io.OutputStream openFileOutputStream(java.lang.String fileName, boolean append) throws java.sql.SQLException
FileSystem
openFileOutputStream
in class FileSystem
fileName
- the file nameappend
- if true, the file will grow, if false, the file will be
truncated first
java.sql.SQLException
public void rename(java.lang.String oldName, java.lang.String newName) throws java.sql.SQLException
FileSystem
rename
in class FileSystem
oldName
- the old fully qualified file namenewName
- the new fully qualified file name
java.sql.SQLException
public boolean tryDelete(java.lang.String fileName)
FileSystem
tryDelete
in class FileSystem
fileName
- the file name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |