Class FilePathSplit
java.lang.Object
org.h2.store.fs.FilePath
org.h2.store.fs.FilePathWrapper
org.h2.store.fs.split.FilePathSplit
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcloseAndThrow(int id, FileChannel[] array, FileChannel o, long maxLength) voiddelete()Delete a file or directory if it exists.(package private) FilePathgetBase(int id) Get the file name of a part file.private longprivate StringgetName(int id) protected StringGet the scheme (prefix) for this file provider.longGet the last modified date of a filevoidRename a file if this is allowed.List the files and directories in the given directory.Create an input stream to read from the file.newOutputStream(boolean append) Create an output stream to write into the file.Open a random access file object.private String[]Split the file name into size and base file name.booleanDisable the ability to write.longsize()Get the size of a file in bytesGet the base path for the given wrapped path.Methods inherited from class FilePathWrapper
canWrite, createDirectory, createFile, createTempFile, exists, getBase, getParent, getPath, isAbsolute, isDirectory, toRealPath, unwrap, wrapMethods inherited from class FilePath
get, getName, newFileChannelOutputStream, register, toString, unregister
-
Field Details
-
PART_SUFFIX
- See Also:
-
-
Constructor Details
-
FilePathSplit
public FilePathSplit()
-
-
Method Details
-
getPrefix
- Overrides:
getPrefixin classFilePathWrapper
-
unwrap
Description copied from class:FilePathWrapperGet the base path for the given wrapped path.- Overrides:
unwrapin classFilePathWrapper- Parameters:
fileName- the path including the scheme prefix- Returns:
- the base file path
-
setReadOnly
public boolean setReadOnly()Description copied from class:FilePathDisable the ability to write.- Overrides:
setReadOnlyin classFilePathWrapper- Returns:
- true if the call was successful
-
delete
public void delete()Description copied from class:FilePathDelete a file or directory if it exists. Directories may only be deleted if they are empty.- Overrides:
deletein classFilePathWrapper
-
lastModified
public long lastModified()Description copied from class:FilePathGet the last modified date of a file- Overrides:
lastModifiedin classFilePathWrapper- Returns:
- the last modified date
-
size
public long size()Description copied from class:FilePathGet the size of a file in bytes- Overrides:
sizein classFilePathWrapper- Returns:
- the size in bytes
-
newDirectoryStream
Description copied from class:FilePathList the files and directories in the given directory.- Overrides:
newDirectoryStreamin classFilePathWrapper- Returns:
- the list of fully qualified file names
-
newInputStream
Description copied from class:FilePathCreate an input stream to read from the file.- Overrides:
newInputStreamin classFilePathWrapper- Returns:
- the input stream
- Throws:
IOException- If an I/O error occurs
-
open
Description copied from class:FilePathOpen a random access file object.- Overrides:
openin classFilePathWrapper- Parameters:
mode- the access mode. Supported are r, rw, rws, rwd- Returns:
- the file object
- Throws:
IOException- If an I/O error occurs
-
getDefaultMaxLength
private long getDefaultMaxLength() -
closeAndThrow
private void closeAndThrow(int id, FileChannel[] array, FileChannel o, long maxLength) throws IOException - Throws:
IOException
-
newOutputStream
Description copied from class:FilePathCreate an output stream to write into the file.- Overrides:
newOutputStreamin classFilePathWrapper- Parameters:
append- if true, the file will grow, if false, the file will be truncated first- Returns:
- the output stream
- Throws:
IOException- If an I/O error occurs
-
moveTo
Description copied from class:FilePathRename a file if this is allowed.- Overrides:
moveToin classFilePathWrapper- Parameters:
path- the new fully qualified file nameatomicReplace- whether the move should be atomic, and the target file should be replaced if it exists and replacing is possible
-
parse
-
getBase
Get the file name of a part file.- Parameters:
id- the part id- Returns:
- the file name including the part id
-
getName
-
getScheme
-