Class ExtendedFile

java.lang.Object
java.io.File
com.topjohnwu.superuser.nio.ExtendedFile
All Implemented Interfaces:
Serializable, Comparable<File>
Direct Known Subclasses:
SuFile

public abstract class ExtendedFile extends File
File API with extended features.

The goal of this class is to extend missing features in the File API that are available in the NIO package but not possible to be re-implemented without low-level file system access. For instance, detecting file types other than regular files and directories, handling and creating hard links and symbolic links.

Another goal of this class is to provide a generalized API interface for custom file system backends. The library includes backends for accessing files locally, accessing files remotely via IPC, and accessing files through shell commands (by using SuFile, included in the io module). The developer can get instances of this class with FileSystemManager.getFile(java.lang.String).

Implementations of this class is required to return the same type of ExtendedFile in all of its APIs returning Files. This means that, for example, if the developer is getting a list of files in a directory using a remote file system with listFiles(), all files returned in the array will also be using the same remote file system backend.

See Also: