Package play.libs

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 Details

    • 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

      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 the replace parameter.
      Parameters:
      destination - the file destination.
      replace - if it should replace an existing file.
      See Also:
    • copyTo

      default Path copyTo(Path destination)
      Copy the file to the specified path destination.
      Parameters:
      destination - the path destination.
      See Also:
    • 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 the replace 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 to moveTo(File).
      Move the file using a File.
      Parameters:
      destination - the path to the destination file
      See Also:
    • moveFileTo

      @Deprecated Path moveFileTo(File destination, boolean replace)
      Deprecated.
      Deprecated as of 2.8.0. Renamed to moveTo(File, boolean).
      Move the file to the specified destination File. In some cases, the source and destination file may point to the same inode. See the documentation for Files.move(Path, Path, CopyOption...) to see more details.
      Parameters:
      destination - the path to the destination file
      replace - 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 to moveTo(Path).
      Move the file using a Path.
      Parameters:
      to - the path to the destination file.
      See Also:
    • moveFileTo

      @Deprecated default Path moveFileTo(Path to, boolean replace)
      Deprecated.
      Deprecated as of 2.8.0. Renamed to moveTo(Path, boolean).
      Move the file using a Path.
      Parameters:
      to - the path to the destination file
      replace - true if an existing file should be replaced, false otherwise.
      See Also:
    • moveTo

      default Path moveTo(File destination)
      Move the file using a File.
      Parameters:
      destination - the path to the destination file
      See Also:
    • moveTo

      Path moveTo(File destination, boolean replace)
      Move the file to the specified destination File. In some cases, the source and destination file may point to the same inode. See the documentation for Files.move(Path, Path, CopyOption...) to see more details.
      Parameters:
      destination - the path to the destination file
      replace - true if an existing file should be replaced, false otherwise.
    • moveTo

      default Path moveTo(Path to)
      Move the file using a Path.
      Parameters:
      to - the path to the destination file.
      See Also:
    • moveTo

      default Path moveTo(Path to, boolean replace)
      Move the file using a Path.
      Parameters:
      to - the path to the destination file
      replace - true if an existing file should be replaced, false otherwise.
      See Also:
    • atomicMoveFileWithFallback

      @Deprecated Path atomicMoveFileWithFallback(File to)
      Deprecated.
      Deprecated as of 2.8.0. Renamed to atomicMoveWithFallback(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 to atomicMoveWithFallback(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