public class FileOpImpl extends FileSystemFileOp
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()
mIsWindows
EMPTY_FILE_ARRAY
Constructor and Description |
---|
FileOpImpl() |
Modifier and Type | Method and Description |
---|---|
void |
deleteOnExit(java.io.File file) |
java.io.File |
ensureRealFile(java.io.File in)
If
in is an in-memory file, write it out as a proper file and return it. |
boolean |
equals(java.lang.Object o) |
protected java.nio.file.FileSystem |
getFileSystem()
Gets the
FileSystem this is based on. |
int |
hashCode() |
canExecute, canWrite, copyFile, createNewFile, delete, deleteFileOrFolder, exists, isDirectory, isFile, isSameFile, isWindows, lastModified, length, list, listFiles, listFiles, mkdirs, newFileInputStream, newFileOutputStream, newFileOutputStream, renameTo, setExecutablePermission, setLastModified, setReadOnly, toPath, toString
protected java.nio.file.FileSystem getFileSystem()
FileSystemFileOp
FileSystem
this is based on.getFileSystem
in class FileSystemFileOp
public java.io.File ensureRealFile(@NonNull java.io.File in)
FileOp
in
is an in-memory file, write it out as a proper file and return it.
Otherwise just return in
.public void deleteOnExit(java.io.File file)
File.deleteOnExit()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object