|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.store.fs.FilePath
org.h2.store.fs.FilePathWrapper
public abstract class FilePathWrapper
The base class for wrapping / delegating file systems such as the split file system.
| Field Summary |
|---|
| Fields inherited from class org.h2.store.fs.FilePath |
|---|
name |
| Constructor Summary | |
|---|---|
FilePathWrapper()
|
|
| Method Summary | |
|---|---|
boolean |
canWrite()
Check if the file is writable. |
void |
createDirectory()
Create a directory (all required parent directories already exist). |
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. |
boolean |
exists()
Checks if a file exists. |
protected FilePath |
getBase()
|
FilePath |
getParent()
Get the parent directory of a file or directory. |
FilePathWrapper |
getPath(java.lang.String path)
Convert a file to a path. |
protected java.lang.String |
getPrefix()
|
boolean |
isAbsolute()
Check if the file name includes a path. |
boolean |
isDirectory()
Check if it is a file or a directory. |
long |
lastModified()
Get the last modified date of a file |
void |
moveTo(FilePath newName)
Rename a file if this is allowed. |
java.util.List<FilePath> |
newDirectoryStream()
List the files and directories in the given directory. |
java.io.InputStream |
newInputStream()
Create an input stream to read from the file. |
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. |
boolean |
setReadOnly()
Disable the ability to write. |
long |
size()
Get the size of a file in bytes |
FilePath |
toRealPath()
Normalize a file name. |
FilePath |
unwrap()
Get the unwrapped file name (without wrapper prefixes if wrapping / delegating file systems are used). |
protected FilePath |
unwrap(java.lang.String path)
Get the base path for the given wrapped path. |
FilePathWrapper |
wrap(FilePath base)
Create a wrapped path instance for the given base path. |
| Methods inherited from class org.h2.store.fs.FilePath |
|---|
get, getName, getNextTempFileNamePart, getScheme, register, toString, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FilePathWrapper()
| Method Detail |
|---|
public FilePathWrapper getPath(java.lang.String path)
FilePathjava.nio.file.spi.FileSystemProvider.getPath, but may
return an object even if the scheme doesn't match in case of the the
default file provider.
getPath in class FilePathpath - the path
public FilePathWrapper wrap(FilePath base)
base - the base path
public FilePath unwrap()
FilePath
unwrap in class FilePathprotected java.lang.String getPrefix()
protected FilePath unwrap(java.lang.String path)
path - the path including the scheme prefix
protected FilePath getBase()
public boolean canWrite()
FilePath
canWrite in class FilePathpublic void createDirectory()
FilePath
createDirectory in class FilePathpublic boolean createFile()
FilePath
createFile in class FilePathpublic void delete()
FilePath
delete in class FilePathpublic boolean exists()
FilePath
exists in class FilePathpublic FilePath getParent()
FilePath
getParent in class FilePathpublic boolean isAbsolute()
FilePath
isAbsolute in class FilePathpublic boolean isDirectory()
FilePath
isDirectory in class FilePathpublic long lastModified()
FilePath
lastModified in class FilePathpublic FilePath toRealPath()
FilePath
toRealPath in class FilePathpublic java.util.List<FilePath> newDirectoryStream()
FilePath
newDirectoryStream in class FilePathpublic void moveTo(FilePath newName)
FilePath
moveTo in class FilePathnewName - the new fully qualified file name
public java.io.InputStream newInputStream()
throws java.io.IOException
FilePath
newInputStream in class FilePathjava.io.IOExceptionpublic java.io.OutputStream newOutputStream(boolean append)
FilePath
newOutputStream in class FilePathappend - if true, the file will grow, if false, the file will be
truncated first
public java.nio.channels.FileChannel open(java.lang.String mode)
throws java.io.IOException
FilePath
open in class FilePathmode - the access mode. Supported are r, rw, rws, rwd
java.io.IOExceptionpublic boolean setReadOnly()
FilePath
setReadOnly in class FilePathpublic long size()
FilePath
size in class FilePath
public FilePath createTempFile(java.lang.String suffix,
boolean deleteOnExit,
boolean inTempDir)
throws java.io.IOException
FilePath
createTempFile in class FilePathsuffix - 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
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||