Class FileOpImpl


  • public class FileOpImpl
    extends FileOp
    Deprecated.
    Use Paths, CancellableFileIo and (for testing) InMemoryFileSystems directly.
    Wraps some common File operations on files and folders.

    This makes it possible to override/mock/stub some file operations in unit tests.

    Instances should be obtained through FileOpUtils.create()

    • Constructor Detail

      • FileOpImpl

        public FileOpImpl()
        Deprecated.
      • FileOpImpl

        public FileOpImpl​(java.nio.file.FileSystem fileSystem)
        Deprecated.
    • Method Detail

      • getFileSystem

        public java.nio.file.FileSystem getFileSystem()
        Deprecated.
        Description copied from class: FileOp
        Returns the FileSystem this is based on.
        Specified by:
        getFileSystem in class FileOp
      • ensureRealFile

        public java.io.File ensureRealFile​(@NonNull
                                           java.io.File in)
        Deprecated.
        Description copied from class: FileOp
        If in is an in-memory file, write it out as a proper file and return it. Otherwise just return in.
        Specified by:
        ensureRealFile in class FileOp
      • deleteOnExit

        public void deleteOnExit​(java.io.File file)
        Deprecated.
        Specified by:
        deleteOnExit in class FileOp
        See Also:
        File.deleteOnExit()
      • toFile

        @NonNull
        public java.io.File toFile​(@NonNull
                                   java.nio.file.Path path)
        Deprecated.
        Description copied from class: FileOp
        Temporary functionality to help with File-to-Path migration. Should only be called when a FileOp is not available and with a Path that is backed by the default FileSystem (notably not in the context of any tests that use MockFileOp or jimfs).
        Specified by:
        toFile in class FileOp
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Deprecated.
        Overrides:
        equals in class java.lang.Object