Package org.h2.test.utils
Class FilePathUnstable
java.lang.Object
org.h2.store.fs.FilePath
org.h2.store.fs.FilePathWrapper
org.h2.test.utils.FilePathUnstable
An unstable file system. It is used to simulate file system problems (for
example out of disk space).
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the scheme (prefix) for this file provider.Open a random access file object.static FilePathUnstableregister()Register the file system.voidsetDiskFullCount(int count, int seed) Set the number of write operations before the disk is full, and the random seed (for partial writes).voidsetPartialWrites(boolean partialWrites) Whether partial writes are possible (writing only part of the data).Methods inherited from class org.h2.store.fs.FilePathWrapper
canWrite, createDirectory, createFile, createTempFile, delete, exists, getBase, getParent, getPath, getPrefix, isAbsolute, isDirectory, isRegularFile, lastModified, moveTo, newDirectoryStream, newInputStream, newOutputStream, setReadOnly, size, toRealPath, unwrap, unwrap, wrapMethods inherited from class org.h2.store.fs.FilePath
get, getName, newFileChannelOutputStream, register, toString, unregister
-
Constructor Details
-
FilePathUnstable
public FilePathUnstable()
-
-
Method Details
-
register
Register the file system.- Returns:
- the instance
-
setDiskFullCount
public void setDiskFullCount(int count, int seed) Set the number of write operations before the disk is full, and the random seed (for partial writes).- Parameters:
count- the number of write operations (0 to never fail, Integer.MAX_VALUE to count the operations)seed- the new seed
-
getDiskFullCount
public int getDiskFullCount() -
setPartialWrites
public void setPartialWrites(boolean partialWrites) Whether partial writes are possible (writing only part of the data).- Parameters:
partialWrites- true to enable
-
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
-
getScheme
Description copied from class:FilePathGet the scheme (prefix) for this file provider. This is similar tojava.nio.file.spi.FileSystemProvider.getScheme.
-