public static interface FileStore.Path
FileStore.| Modifier and Type | Method and Description |
|---|---|
FileStore.Path |
clonePath()
Creates a deep copy of the path that does not share any mutable state with the original.
|
default void |
copyFile(FileStore.Path toFile)
Copies the file at this path to a new path.
|
default void |
copyFiles(FileStore.Path toPath)
Copies all files from under the current path, to a new root path, maintaining the relative path structure of all copied files.
|
void |
deleteFile()
Deletes the file at this path.
|
boolean |
exists() |
boolean |
fileExists() |
FileStore.Reader |
fileReader() |
FileStore.Writer |
fileWriter() |
Stream<? extends FileStore.Path> |
getFileDescendents()
Finds all files that are descendents of the current path and returns them as a stream.
|
default DataSize |
getFileSize()
Determines the exact size of the file at the given path.
|
Optional<String> |
getLeafName() |
Optional<? extends FileStore.Path> |
getParent() |
String |
getPathName() |
default void |
moveFile(FileStore.Path toFile)
Moves the file at this path to a new path.
|
FileStore.Path |
path(String... pathComponents) |
default Snapshot |
snapshot()
Creates a new snapshot of all files under the current path.
|
default boolean |
tryDeleteFile()
Attempts to delete the file at this path, if it exists.
|
default boolean |
tryFileExists()
Determines if a file exists at the current path.
|
default void |
unpack(Snapshot snapshot)
Unpacks the contents of the given snapshot at the current path.
|
FileStore.Path path(String... pathComponents)
FileStore.Path relative to the current path.boolean fileExists()
throws IOException
IOException - if the existence of the file cannot be establishedboolean exists()
throws IOException
IOException - if the existence of the file cannot be establisheddefault boolean tryFileExists()
FileStore.Reader fileReader()
FileStore.Reader for the file at this pathFileStore.Writer fileWriter()
FileStore.Writer for the file at this pathvoid deleteFile()
throws IOException
FileNotFoundException - If no file exists at this pathIOException - if the file could not be deletedFileStore.Path clonePath()
default boolean tryDeleteFile()
default void moveFile(FileStore.Path toFile) throws IOException
The default implementation of this method first copies the data from the source file to the target, and then deletes the source file, but concrete implementations may provide a more efficient solution.
IOException - If the move failsdefault void copyFile(FileStore.Path toFile) throws IOException
The default implementation of this method streams the data from the source to the target, but concrete impementations may provide a more efficient solution.
IOException - If the move failsdefault void copyFiles(FileStore.Path toPath) throws IOException
snapshot() of the current path, then unpack(Snapshot)s that
snapshot at the new path. Concrete implementations may perform a more optimised copy.IOExceptiondefault DataSize getFileSize() throws IOException
IOException - if the file size cannot be determinedString getPathName()
FileStore.root().Optional<String> getLeafName()
Optional<? extends FileStore.Path> getParent()
FileStore.root().Stream<? extends FileStore.Path> getFileDescendents() throws IOException
The files returned by this method will always be ordered lexicographically by their path name, sorted as if any path components are separated by the "/" character, rather than the platform-specific file separator.
IOException - if the descents cannot be determined.default Snapshot snapshot() throws IOException
IOExceptiondefault void unpack(Snapshot snapshot) throws IOException
IOExceptionCopyright © 2021–2024 Atlassian. All rights reserved.