Interface Files.TemporaryFile
-
- All Known Implementing Classes:
Files.DelegateTemporaryFile
- Enclosing class:
- Files
public static interface Files.TemporaryFile
A temporary file created by a TemporaryFileCreator.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Path
atomicMoveFileWithFallback(File to)
Deprecated.Deprecated as of 2.8.0.default Path
atomicMoveFileWithFallback(Path to)
Deprecated.Deprecated as of 2.8.0.Path
atomicMoveWithFallback(File to)
Attempts to move source to target atomically and falls back to a non-atomic move if it fails.default Path
atomicMoveWithFallback(Path to)
Attempts to move source to target atomically and falls back to a non-atomic move if it fails.default Path
copyTo(File destination)
Copy the temporary file to the specified destination.default Path
copyTo(File destination, boolean replace)
Copy the file to the specified destination and, if the destination exists, decide if replace it based on thereplace
parameter.default Path
copyTo(Path destination)
Copy the file to the specified path destination.Path
copyTo(Path destination, boolean replace)
Copy the file to the specified path destination and, if the destination exists, decide if replace it based on thereplace
parameter.default Path
moveFileTo(File destination)
Deprecated.Deprecated as of 2.8.0.Path
moveFileTo(File destination, boolean replace)
Deprecated.Deprecated as of 2.8.0.default Path
moveFileTo(Path to)
Deprecated.Deprecated as of 2.8.0.default Path
moveFileTo(Path to, boolean replace)
Deprecated.Deprecated as of 2.8.0.default Path
moveTo(File destination)
Move the file using aFile
.Path
moveTo(File destination, boolean replace)
Move the file to the specified destinationFile
.default Path
moveTo(Path to)
Move the file using aPath
.default Path
moveTo(Path to, boolean replace)
Move the file using aPath
.Path
path()
Files.TemporaryFileCreator
temporaryFileCreator()
-
-
-
Method Detail
-
path
Path path()
- Returns:
- the path to the temporary file.
-
temporaryFileCreator
Files.TemporaryFileCreator temporaryFileCreator()
-
copyTo
default Path copyTo(File destination)
Copy the temporary file to the specified destination.- Parameters:
destination
- the file destination.- See Also:
copyTo(Path, boolean)
-
copyTo
default Path copyTo(File destination, boolean replace)
Copy the file to the specified destination and, if the destination exists, decide if replace it based on thereplace
parameter.- Parameters:
destination
- the file destination.replace
- if it should replace an existing file.- See Also:
copyTo(Path, boolean)
-
copyTo
default Path copyTo(Path destination)
Copy the file to the specified path destination.- Parameters:
destination
- the path destination.- See Also:
copyTo(Path, boolean)
-
copyTo
Path copyTo(Path destination, boolean replace)
Copy the file to the specified path destination and, if the destination exists, decide if replace it based on thereplace
parameter.- Parameters:
destination
- the path destination.replace
- if it should replace an existing file.
-
moveFileTo
@Deprecated default Path moveFileTo(File destination)
Deprecated.Deprecated as of 2.8.0. Renamed tomoveTo(File)
.Move the file using aFile
.- Parameters:
destination
- the path to the destination file- See Also:
moveFileTo(Path, boolean)
-
moveFileTo
@Deprecated Path moveFileTo(File destination, boolean replace)
Deprecated.Deprecated as of 2.8.0. Renamed tomoveTo(File, boolean)
.Move the file to the specified destinationFile
. In some cases, the source and destination file may point to the sameinode
. See the documentation forFiles.move(Path, Path, CopyOption...)
to see more details.- Parameters:
destination
- the path to the destination filereplace
- true if an existing file should be replaced, false otherwise.
-
moveFileTo
@Deprecated default Path moveFileTo(Path to)
Deprecated.Deprecated as of 2.8.0. Renamed tomoveTo(Path)
.Move the file using aPath
.- Parameters:
to
- the path to the destination file.- See Also:
moveFileTo(Path, boolean)
-
moveFileTo
@Deprecated default Path moveFileTo(Path to, boolean replace)
Deprecated.Deprecated as of 2.8.0. Renamed tomoveTo(Path, boolean)
.Move the file using aPath
.- Parameters:
to
- the path to the destination filereplace
- true if an existing file should be replaced, false otherwise.- See Also:
moveFileTo(Path, boolean)
-
moveTo
default Path moveTo(File destination)
Move the file using aFile
.- Parameters:
destination
- the path to the destination file- See Also:
moveTo(Path, boolean)
-
moveTo
Path moveTo(File destination, boolean replace)
Move the file to the specified destinationFile
. In some cases, the source and destination file may point to the sameinode
. See the documentation forFiles.move(Path, Path, CopyOption...)
to see more details.- Parameters:
destination
- the path to the destination filereplace
- true if an existing file should be replaced, false otherwise.
-
moveTo
default Path moveTo(Path to)
Move the file using aPath
.- Parameters:
to
- the path to the destination file.- See Also:
moveTo(Path, boolean)
-
moveTo
default Path moveTo(Path to, boolean replace)
Move the file using aPath
.- Parameters:
to
- the path to the destination filereplace
- true if an existing file should be replaced, false otherwise.- See Also:
moveTo(Path, boolean)
-
atomicMoveFileWithFallback
@Deprecated Path atomicMoveFileWithFallback(File to)
Deprecated.Deprecated as of 2.8.0. Renamed toatomicMoveWithFallback(File)
.Attempts to move source to target atomically and falls back to a non-atomic move if it fails.This always tries to replace existent files. Since it is platform dependent if atomic moves replaces existent files or not, considering that it will always replaces, makes the API more predictable.
- Parameters:
to
- the path to the destination file
-
atomicMoveFileWithFallback
@Deprecated default Path atomicMoveFileWithFallback(Path to)
Deprecated.Deprecated as of 2.8.0. Renamed toatomicMoveWithFallback(Path)
.Attempts to move source to target atomically and falls back to a non-atomic move if it fails.This always tries to replace existent files. Since it is platform dependent if atomic moves replaces existent files or not, considering that it will always replaces, makes the API more predictable.
- Parameters:
to
- the path to the destination file
-
atomicMoveWithFallback
Path atomicMoveWithFallback(File to)
Attempts to move source to target atomically and falls back to a non-atomic move if it fails.This always tries to replace existent files. Since it is platform dependent if atomic moves replaces existent files or not, considering that it will always replaces, makes the API more predictable.
- Parameters:
to
- the path to the destination file
-
atomicMoveWithFallback
default Path atomicMoveWithFallback(Path to)
Attempts to move source to target atomically and falls back to a non-atomic move if it fails.This always tries to replace existent files. Since it is platform dependent if atomic moves replaces existent files or not, considering that it will always replaces, makes the API more predictable.
- Parameters:
to
- the path to the destination file
-
-