All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----org.jos.fs.util.AbstractFileSystem | +----org.jos.fs.util.UnionFileSystem
For example (symbolic code, not runnable):
UnionFileSystem ufs = new UnionFileSystem(); ufs.mount("floppy", new FAT(new DiskMedium(0))); ufs.mount("harddrive", new FAT(new DiskMedium(1))); ufs.mount("myftpserver", new FTP_FS("ftp.myserver.com")); ufs.delete("floppy/afile"); ufs.rename("harddrive/localfolder/hello.txt", "myftpserver/hello.txt"); // This actually moves hello.txt to the FTP serverHmm, almost every method is synchronized. This produces a some overhead, but we have to ensure that a mount or dismount doesn't disturb any regular FS operations occuring at the same time.
UnionFileSystem leaves the case policy of mounted file systems unchanged. The default policy for the mount paths is case-insensitive- case-preserving. This means you can't mount "disk" and "Disk" at the same time. Also, if a file system reports CASEPOLICY_UNKNOWN, it is assumed to be case-insensitive (since an assumption must be made when another FS is mounted inside of a CASEPOLICY_UNKNOWN FS).
TODO: synchronization
TODO: add addSeparator() calls in some methods? (If the mount path of a FS is passed as an argument)
TODO: consequent CS/CI handling, change all methods to tree structure
public UnionFileSystem()
public int getCasePolicyForDir(String dir)
public FSBranchInfo getBranchInfo(String branch)
public Medium getMedium()
public FSFileInfo getFileInfo(String path) throws IOException
public void delete(String path) throws IOException
public void rename(String from, String to) throws IOException
public void mkdir(String path) throws IOException
public String[] dirList(String path) throws IOException
public FSFile openFile(String file, boolean readAccess, boolean writeAccess) throws IOException
public void mount(String path, FileSystem fs) throws FSException
public void unmount(String path) throws FSException
public void entityCreated(FileSystemEvent evt)
public void entityDeleted(FileSystemEvent evt)
public void entityRenamed(FileSystemEvent evt)
public void entityChanged(FileSystemEvent evt)
All Packages Class Hierarchy This Package Previous Next Index