|
||||||||
| 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.FileSystemMemory
public class FileSystemMemory
This file system keeps files fully in memory. There is an option to compress file blocks to safe memory.
| Field Summary | |
|---|---|
static java.lang.String |
PREFIX
The prefix used for an in-memory file system. |
static java.lang.String |
PREFIX_LZF
The prefix used for a compressed in-memory file system. |
| Method Summary | |
|---|---|
protected boolean |
accepts(java.lang.String fileName)
Check if the file system is responsible for this file name. |
boolean |
canWrite(java.lang.String fileName)
Check if the file is writable. |
void |
copy(java.lang.String source,
java.lang.String target)
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. |
void |
delete(java.lang.String fileName)
Delete a file. |
void |
deleteRecursive(java.lang.String fileName,
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 |
getCanonicalPath(java.lang.String fileName)
Normalize a file name. |
java.lang.String |
getFileName(java.lang.String name)
Get the file name (without directory part). |
static FileSystemMemory |
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 path)
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.FileSystem |
|---|
createTempFile, 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 |
|---|
public static final java.lang.String PREFIX
public static final java.lang.String PREFIX_LZF
| Method Detail |
|---|
public static FileSystemMemory getInstance()
public long length(java.lang.String fileName)
FileSystem
length in class FileSystemfileName - the file name
public void rename(java.lang.String oldName,
java.lang.String newName)
FileSystem
rename in class FileSystemoldName - the old fully qualified file namenewName - the new fully qualified file namepublic boolean createNewFile(java.lang.String fileName)
FileSystem
createNewFile in class FileSystemfileName - the file name
public boolean exists(java.lang.String fileName)
FileSystem
exists in class FileSystemfileName - the file name
public void delete(java.lang.String fileName)
FileSystem
delete in class FileSystemfileName - the file namepublic boolean tryDelete(java.lang.String fileName)
FileSystem
tryDelete in class FileSystemfileName - the file name
public java.lang.String[] listFiles(java.lang.String path)
FileSystem
listFiles in class FileSystempath - the directory
public void deleteRecursive(java.lang.String fileName,
boolean tryOnly)
FileSystem
deleteRecursive in class FileSystemfileName - the directorytryOnly - whether errors should be ignoredpublic boolean isReadOnly(java.lang.String fileName)
FileSystem
isReadOnly in class FileSystemfileName - the file name
public boolean setReadOnly(java.lang.String fileName)
FileSystem
setReadOnly in class FileSystemfileName - the file name
public java.lang.String getCanonicalPath(java.lang.String fileName)
FileSystem
getCanonicalPath in class FileSystemfileName - the file name
public java.lang.String getParent(java.lang.String fileName)
FileSystem
getParent in class FileSystemfileName - the file or directory name
public boolean isDirectory(java.lang.String fileName)
FileSystem
isDirectory in class FileSystemfileName - the file or directory name
public boolean isAbsolute(java.lang.String fileName)
FileSystem
isAbsolute in class FileSystemfileName - the file name
public long getLastModified(java.lang.String fileName)
FileSystem
getLastModified in class FileSystemfileName - the file name
public boolean canWrite(java.lang.String fileName)
FileSystem
canWrite in class FileSystemfileName - the file name
public void copy(java.lang.String source,
java.lang.String target)
FileSystem
copy in class FileSystemsource - the name of the original filetarget - the file name of the copypublic void createDirs(java.lang.String fileName)
FileSystem
createDirs in class FileSystemfileName - the file name (not directory name)public java.lang.String getFileName(java.lang.String name)
FileSystem
getFileName in class FileSystemname - the directory and file name
public boolean fileStartsWith(java.lang.String fileName,
java.lang.String prefix)
FileSystem
fileStartsWith in class FileSystemfileName - the complete file nameprefix - the prefix
public java.io.OutputStream openFileOutputStream(java.lang.String fileName,
boolean append)
FileSystem
openFileOutputStream in class FileSystemfileName - the file nameappend - if true, the file will grow, if false, the file will be
truncated first
public java.io.InputStream openFileInputStream(java.lang.String fileName)
FileSystem
openFileInputStream in class FileSystemfileName - the file name
public FileObject openFileObject(java.lang.String fileName,
java.lang.String mode)
FileSystem
openFileObject in class FileSystemfileName - the file namemode - the access mode. Supported are r, rw, rws, rwd
protected boolean accepts(java.lang.String fileName)
FileSystem
accepts in class FileSystemfileName - the file name
public java.lang.String unwrap(java.lang.String fileName)
FileSystem
unwrap in class FileSystemfileName - the file name
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||