public interface FileSystemAbstraction extends Closeable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
FileSystemAbstraction.ThirdPartyFileSystem |
| Modifier and Type | Method and Description |
|---|---|
void |
copyFile(File from,
File to) |
void |
copyRecursively(File fromDirectory,
File toDirectory) |
StoreChannel |
create(File fileName) |
boolean |
deleteFile(File fileName) |
void |
deleteFileOrThrow(File file) |
void |
deleteRecursively(File directory) |
boolean |
fileExists(File fileName) |
FileWatcher |
fileWatcher()
Create file watcher that provides possibilities to monitor directories on underlying file system
abstraction
|
long |
getFileSize(File fileName) |
<K extends FileSystemAbstraction.ThirdPartyFileSystem> |
getOrCreateThirdPartyFileSystem(Class<K> clazz,
Function<Class<K>,K> creator) |
boolean |
isDirectory(File file) |
long |
lastModifiedTime(File file) |
File[] |
listFiles(File directory) |
File[] |
listFiles(File directory,
FilenameFilter filter) |
boolean |
mkdir(File fileName) |
void |
mkdirs(File fileName) |
void |
moveToDirectory(File file,
File toDirectory) |
StoreChannel |
open(File fileName,
String mode) |
InputStream |
openAsInputStream(File fileName) |
OutputStream |
openAsOutputStream(File fileName,
boolean append) |
Reader |
openAsReader(File fileName,
Charset charset) |
Writer |
openAsWriter(File fileName,
Charset charset,
boolean append) |
void |
renameFile(File from,
File to,
CopyOption... copyOptions) |
Stream<FileHandle> |
streamFilesRecursive(File directory)
Return a stream of
file handles for every file in the given directory, and its
sub-directories. |
void |
truncate(File path,
long size) |
FileWatcher fileWatcher() throws IOException
IOException - in case exception occur during file watcher creationStoreChannel open(File fileName, String mode) throws IOException
IOExceptionOutputStream openAsOutputStream(File fileName, boolean append) throws IOException
IOExceptionInputStream openAsInputStream(File fileName) throws IOException
IOExceptionReader openAsReader(File fileName, Charset charset) throws IOException
IOExceptionWriter openAsWriter(File fileName, Charset charset, boolean append) throws IOException
IOExceptionStoreChannel create(File fileName) throws IOException
IOExceptionboolean fileExists(File fileName)
boolean mkdir(File fileName)
void mkdirs(File fileName) throws IOException
IOExceptionlong getFileSize(File fileName)
boolean deleteFile(File fileName)
void deleteRecursively(File directory) throws IOException
IOExceptionvoid renameFile(File from, File to, CopyOption... copyOptions) throws IOException
IOExceptionFile[] listFiles(File directory, FilenameFilter filter)
boolean isDirectory(File file)
void moveToDirectory(File file, File toDirectory) throws IOException
IOExceptionvoid copyFile(File from, File to) throws IOException
IOExceptionvoid copyRecursively(File fromDirectory, File toDirectory) throws IOException
IOException<K extends FileSystemAbstraction.ThirdPartyFileSystem> K getOrCreateThirdPartyFileSystem(Class<K> clazz, Function<Class<K>,K> creator)
void truncate(File path, long size) throws IOException
IOExceptionlong lastModifiedTime(File file) throws IOException
IOExceptionvoid deleteFileOrThrow(File file) throws IOException
IOExceptionStream<FileHandle> streamFilesRecursive(File directory) throws IOException
file handles for every file in the given directory, and its
sub-directories.
Alternatively, if the File given as an argument refers to a file instead of a directory, then a stream
will be returned with a file handle for just that file.
The stream is based on a snapshot of the file tree, so changes made to the tree using the returned file handles will not be reflected in the stream.
No directories will be returned. Only files. If a file handle ends up leaving a directory empty through a rename or a delete, then the empty directory will automatically be deleted as well. Likewise, if a file is moved to a path where not all of the directories in the path exists, then those missing directories will be created prior to the file rename.
directory - The base directory to start streaming files from, or the specific individual file to stream.NoSuchFileException - If the given base directory or file does not exists.IOException - If an I/O error occurs, possibly with the canonicalisation of the paths.Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.