Top Description Fields Constructors Methods
org.h2.store.fs.split

public Class FilePathSplit

extends FilePathWrapper
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, .SequenceInputStream, java.nio.channels.FileChannel, java.util.ArrayList, .List, org.h2.engine.SysProperties, org.h2.message.DbException, org.h2.store.fs.FilePath, .FilePathWrapper

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

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
closeAndThrow(int id, FileChannel[] array, FileChannel o, long maxLength)

public void
delete()

Overrides org.h2.store.fs.FilePathWrapper.delete.

Delete a file or directory if it exists.

pack-priv FilePath

Returns:

the file name including the part id
getBase
(int
the part id
id
)

Get the file name of a part file.

private long
private String
getName(int id)

protected String
public String
getScheme()

Implements abstract org.h2.store.fs.FilePath.getScheme.

Get the scheme (prefix) for this file provider.

public long
lastModified()

Overrides org.h2.store.fs.FilePathWrapper.lastModified.

Get the last modified date of a file

public void
moveTo(FilePath
the new fully qualified file name
path
,
boolean
whether the move should be atomic, and the target file should be replaced if it exists and replacing is possible
atomicReplace
)

Overrides org.h2.store.fs.FilePathWrapper.moveTo.

Rename a file if this is allowed.

public ArrayList<FilePath>
newDirectoryStream()

Overrides org.h2.store.fs.FilePathWrapper.newDirectoryStream.

List the files and directories in the given directory.

public InputStream
newInputStream()

Overrides org.h2.store.fs.FilePathWrapper.newInputStream.

Create an input stream to read from the file.

public OutputStream
newOutputStream(boolean
if true, the file will grow, if false, the file will be truncated first
append
)

Overrides org.h2.store.fs.FilePathWrapper.newOutputStream.

Create an output stream to write into the file.

public FileChannel
open(String
the access mode. Supported are r, rw, rws, rwd
mode
)

Overrides org.h2.store.fs.FilePathWrapper.open.

Open a random access file object.

private String[]

Returns:

an array with size and file name
parse
(String
the file name
fileName
)

Split the file name into size and base file name.

public boolean
setReadOnly()

Overrides org.h2.store.fs.FilePathWrapper.setReadOnly.

Disable the ability to write.

public long
size()

Overrides org.h2.store.fs.FilePathWrapper.size.

Get the size of a file in bytes

public FilePath
unwrap(String
the path including the scheme prefix
fileName
)

Overrides org.h2.store.fs.FilePathWrapper.unwrap.

Get the base path for the given wrapped path.

Inherited from org.h2.store.fs.FilePathWrapper:
canWritecreateDirectorycreateFilecreateTempFileexistsgetBasegetParentgetPathisAbsoluteisDirectoryisRegularFiletoRealPathunwrapwrap

Field Detail

PART_SUFFIXback to summary
private static final String PART_SUFFIX

Constructor Detail

FilePathSplitback to summary
public FilePathSplit()

Method Detail

closeAndThrowback to summary
private void closeAndThrow(int id, FileChannel[] array, FileChannel o, long maxLength) throws IOException
deleteback to summary
public void delete()

Overrides org.h2.store.fs.FilePathWrapper.delete.

Doc from org.h2.store.fs.FilePath.delete.

Delete a file or directory if it exists. Directories may only be deleted if they are empty.

Annotations
@Override
getBaseback to summary
pack-priv FilePath getBase(int id)

Get the file name of a part file.

Parameters
id:int

the part id

Returns:FilePath

the file name including the part id

getDefaultMaxLengthback to summary
private long getDefaultMaxLength()
getNameback to summary
private String getName(int id)
getPrefixback to summary
protected String getPrefix()

Overrides org.h2.store.fs.FilePathWrapper.getPrefix.

Annotations
@Override
getSchemeback to summary
public String getScheme()

Implements abstract org.h2.store.fs.FilePath.getScheme.

Doc from org.h2.store.fs.FilePath.getScheme.

Get the scheme (prefix) for this file provider. This is similar to java.nio.file.spi.FileSystemProvider.getScheme.

Returns:String

the scheme

Annotations
@Override
lastModifiedback to summary
public long lastModified()

Overrides org.h2.store.fs.FilePathWrapper.lastModified.

Doc from org.h2.store.fs.FilePath.lastModified.

Get the last modified date of a file

Returns:long

the last modified date

Annotations
@Override
moveToback to summary
public void moveTo(FilePath path, boolean atomicReplace)

Overrides org.h2.store.fs.FilePathWrapper.moveTo.

Doc from org.h2.store.fs.FilePath.moveTo.

Rename a file if this is allowed.

Parameters
path:FilePath

the new fully qualified file name

atomicReplace:boolean

whether the move should be atomic, and the target file should be replaced if it exists and replacing is possible

Annotations
@Override
newDirectoryStreamback to summary
public ArrayList<FilePath> newDirectoryStream()

Overrides org.h2.store.fs.FilePathWrapper.newDirectoryStream.

Doc from org.h2.store.fs.FilePath.newDirectoryStream.

List the files and directories in the given directory.

Returns:ArrayList<FilePath>

the list of fully qualified file names

Annotations
@Override
newInputStreamback to summary
public InputStream newInputStream() throws IOException

Overrides org.h2.store.fs.FilePathWrapper.newInputStream.

Doc from org.h2.store.fs.FilePath.newInputStream.

Create an input stream to read from the file.

Returns:InputStream

the input stream

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
newOutputStreamback to summary
public OutputStream newOutputStream(boolean append) throws IOException

Overrides org.h2.store.fs.FilePathWrapper.newOutputStream.

Doc from org.h2.store.fs.FilePath.newOutputStream.

Create an output stream to write into the file.

Parameters
append:boolean

if true, the file will grow, if false, the file will be truncated first

Returns:OutputStream

the output stream

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
openback to summary
public FileChannel open(String mode) throws IOException

Overrides org.h2.store.fs.FilePathWrapper.open.

Doc from org.h2.store.fs.FilePath.open.

Open a random access file object.

Parameters
mode:String

the access mode. Supported are r, rw, rws, rwd

Returns:FileChannel

the file object

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
parseback to summary
private String[] parse(String fileName)

Split the file name into size and base file name.

Parameters
fileName:String

the file name

Returns:String[]

an array with size and file name

setReadOnlyback to summary
public boolean setReadOnly()

Overrides org.h2.store.fs.FilePathWrapper.setReadOnly.

Doc from org.h2.store.fs.FilePath.setReadOnly.

Disable the ability to write.

Returns:boolean

true if the call was successful

Annotations
@Override
sizeback to summary
public long size()

Overrides org.h2.store.fs.FilePathWrapper.size.

Doc from org.h2.store.fs.FilePath.size.

Get the size of a file in bytes

Returns:long

the size in bytes

Annotations
@Override
unwrapback to summary
public FilePath unwrap(String fileName)

Overrides org.h2.store.fs.FilePathWrapper.unwrap.

Doc from org.h2.store.fs.FilePathWrapper.unwrap.

Get the base path for the given wrapped path.

Parameters
fileName:String

the path including the scheme prefix

Returns:FilePath

the base file path

Annotations
@Override