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 Detail

      • path

        Path path()
        Returns:
        the path to the temporary file.
      • 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 the replace 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 the replace parameter.
        Parameters:
        destination - the path destination.
        replace - if it should replace an existing file.
      • 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.
      • moveTo

        default Path moveTo​(File destination)
        Move the file using a File.
        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 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,
                            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:
        moveTo(Path, boolean)
      • 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