Package com.android.repository.io.impl
Class FileOpImpl
- java.lang.Object
-
- com.android.repository.io.FileOp
-
- com.android.repository.io.impl.FileOpImpl
-
public class FileOpImpl extends FileOp
Deprecated.UsePaths,CancellableFileIoand (for testing)InMemoryFileSystemsdirectly.Wraps some commonFileoperations 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 Summary
Constructors Constructor Description FileOpImpl()Deprecated.FileOpImpl(java.nio.file.FileSystem fileSystem)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddeleteOnExit(java.io.File file)Deprecated.java.io.FileensureRealFile(java.io.File in)Deprecated.Ifinis an in-memory file, write it out as a proper file and return it.booleanequals(java.lang.Object o)Deprecated.java.nio.file.FileSystemgetFileSystem()Deprecated.Returns theFileSystemthis is based on.inthashCode()Deprecated.java.io.FiletoFile(java.nio.file.Path path)Deprecated.Temporary functionality to help with File-to-Path migration.-
Methods inherited from class com.android.repository.io.FileOp
canExecute, canWrite, copyFile, createNewFile, delete, deleteFileOrFolder, exists, isDirectory, isFile, isSameFile, lastModified, length, list, listFiles, listFiles, mkdirs, newFileInputStream, newFileInputStream, newFileOutputStream, newFileOutputStream, readText, renameTo, setExecutablePermission, setLastModified, setLastModified, setReadOnly, toPath, toPath
-
-
-
-
Method Detail
-
getFileSystem
public java.nio.file.FileSystem getFileSystem()
Deprecated.Description copied from class:FileOpReturns theFileSystemthis is based on.- Specified by:
getFileSystemin classFileOp
-
ensureRealFile
public java.io.File ensureRealFile(@NonNull java.io.File in)Deprecated.Description copied from class:FileOpIfinis an in-memory file, write it out as a proper file and return it. Otherwise just returnin.- Specified by:
ensureRealFilein classFileOp
-
deleteOnExit
public void deleteOnExit(java.io.File file)
Deprecated.- Specified by:
deleteOnExitin classFileOp- See Also:
File.deleteOnExit()
-
toFile
@NonNull public java.io.File toFile(@NonNull java.nio.file.Path path)Deprecated.Description copied from class:FileOpTemporary 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).
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
Deprecated.- Overrides:
equalsin classjava.lang.Object
-
-