public static interface Files.TemporaryFile
Modifier and Type | Method and Description |
---|---|
Files.TemporaryFile |
atomicMoveWithFallback(java.io.File to)
Attempts to move source to target atomically and falls back to a non-atomic move if it fails.
|
default Files.TemporaryFile |
atomicMoveWithFallback(java.nio.file.Path to)
Attempts to move source to target atomically and falls back to a non-atomic move if it fails.
|
default Files.TemporaryFile |
copyTo(java.io.File destination)
Copy the temporary file to the specified destination.
|
default Files.TemporaryFile |
copyTo(java.io.File destination,
boolean replace)
Copy the file to the specified destination and, if the destination exists, decide if replace it
based on the
replace parameter. |
default Files.TemporaryFile |
copyTo(java.nio.file.Path destination)
Copy the file to the specified path destination.
|
Files.TemporaryFile |
copyTo(java.nio.file.Path destination,
boolean replace)
Copy the file to the specified path destination and, if the destination exists, decide if replace it
based on the
replace parameter. |
default Files.TemporaryFile |
moveTo(java.io.File destination)
Move the file using a
File . |
Files.TemporaryFile |
moveTo(java.io.File destination,
boolean replace)
Move the file to the specified destination
File . |
default Files.TemporaryFile |
moveTo(java.nio.file.Path to)
Move the file using a
Path . |
default Files.TemporaryFile |
moveTo(java.nio.file.Path to,
boolean replace)
Move the file using a
Path . |
java.nio.file.Path |
path() |
Files.TemporaryFileCreator |
temporaryFileCreator() |
java.nio.file.Path path()
Files.TemporaryFileCreator temporaryFileCreator()
default Files.TemporaryFile copyTo(java.io.File destination)
destination
- the file destination.copyTo(Path, boolean)
default Files.TemporaryFile copyTo(java.io.File destination, boolean replace)
replace
parameter.destination
- the file destination.replace
- if it should replace an existing file.copyTo(Path, boolean)
default Files.TemporaryFile copyTo(java.nio.file.Path destination)
destination
- the path destination.copyTo(Path, boolean)
Files.TemporaryFile copyTo(java.nio.file.Path destination, boolean replace)
replace
parameter.destination
- the path destination.replace
- if it should replace an existing file.default Files.TemporaryFile moveTo(java.io.File destination)
File
.destination
- the path to the destination filemoveTo(Path, boolean)
Files.TemporaryFile moveTo(java.io.File destination, boolean replace)
File
. In some cases, the source and destination file
may point to the same inode
meaning that deleting the source will result in the destination being deleted
too. See the documentation for Files.move(Path, Path, CopyOption...)
to see more details.
This behavior is especially relevant if you are also using the Files.TemporaryFileReaper
which deletes temporary files.destination
- the path to the destination filereplace
- true if an existing file should be replaced, false otherwise.default Files.TemporaryFile moveTo(java.nio.file.Path to)
Path
.to
- the path to the destination file.moveTo(Path, boolean)
default Files.TemporaryFile moveTo(java.nio.file.Path to, boolean replace)
Path
.to
- the path to the destination filereplace
- true if an existing file should be replaced, false otherwise.moveTo(Path, boolean)
Files.TemporaryFile atomicMoveWithFallback(java.io.File to)
to
- the path to the destination filedefault Files.TemporaryFile atomicMoveWithFallback(java.nio.file.Path to)
to
- the path to the destination file