public interface FileHandle
PageCache.streamFilesRecursive(File)| Modifier and Type | Field and Description |
|---|---|
static Consumer<FileHandle> |
HANDLE_DELETE
Useful consumer when doing deletion in stream pipeline.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Delete the file that this file handle represents.
|
File |
getFile()
Get a
File object for the abstract path name that this file handle represents. |
static Consumer<FileHandle> |
handleRenameBetweenDirectories(File from,
File to)
Create a consumer of FileHandle that uses fileHandle.rename to move file held by file handle to move from
directory to directory.
|
void |
rename(File to,
CopyOption... options)
Rename source file to the given target file, effectively moving the file from source to target.
|
static final Consumer<FileHandle> HANDLE_DELETE
Possible IOException caused by fileHandle.delete() is wrapped in UncheckedIOException
static Consumer<FileHandle> handleRenameBetweenDirectories(File from, File to)
Possibly IOException will be wrapped in UncheckedIOException
from - Directory to move file from.to - Directory to move file to.File getFile()
File object for the abstract path name that this file handle represents.
Note that the File is not guaranteed to support any operations other than querying the path name.
For instance, to delete the file you have to use the delete() method of this file handle, instead of
File.delete().File for this file handle.void rename(File to, CopyOption... options) throws IOException
to - The new name of the file after the rename.options - Options to modify the behaviour of the move in possibly platform specific ways. In particular,
StandardCopyOption.REPLACE_EXISTING may be used to overwrite any existing file at the
target path name, instead of throwing an exception.org.neo4j.io.pagecache.impl.FileIsMappedException - if either the file represented by this file handle is
mapped, or the target file is mapped.FileAlreadyExistsException - if the target file already exists, and the
StandardCopyOption.REPLACE_EXISTING open option was not specified.IOException - if an I/O error occurs, for instance when canonicalising the to path.void delete()
throws IOException
org.neo4j.io.pagecache.impl.FileIsMappedException - if this file is mapped by the page cache.NoSuchFileException - if the underlying file was deleted after this handle was created.IOException - if an I/O error occurs.Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.