dk.apaq.vfs.impl.subfs
Class SubFs

java.lang.Object
  extended by dk.apaq.vfs.impl.subfs.SubFs
All Implemented Interfaces:
FileSystem, Serializable

public class SubFs
extends Object
implements FileSystem

Author:
michael
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface dk.apaq.vfs.FileSystem
FSInfo_Description, FSInfo_HasFreeSpaceInformation, FSInfo_HasSizeInformation, FSInfo_Name, FSInfo_Version
 
Constructor Summary
SubFs(FileSystem fs, Directory root)
           
 
Method Summary
 void close()
           
 long getFreeSpace()
          Retrieves the free space available.
 Map getInfo()
          Retrieves a list of information about the filesystem.
 String getName()
          Retrieves the name of the filesystem.
 Node getNode(String path)
           
 Directory getRoot()
          Retrieves the root directory of the filesystem.
 long getSize()
          Retrieves the size of the filesystem in bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubFs

public SubFs(FileSystem fs,
             Directory root)
Method Detail

getName

public String getName()
Description copied from interface: FileSystem
Retrieves the name of the filesystem.

Specified by:
getName in interface FileSystem
Returns:
The name.

getInfo

public Map getInfo()
Description copied from interface: FileSystem
Retrieves a list of information about the filesystem.

Specified by:
getInfo in interface FileSystem
Returns:
A map hold key/pair information about the filesystem. Default keys are available as static variables on the FileSystem interface.

getRoot

public Directory getRoot()
                  throws FileNotFoundException
Description copied from interface: FileSystem
Retrieves the root directory of the filesystem.

Specified by:
getRoot in interface FileSystem
Returns:
The root directory.
Throws:
FileNotFoundException - Thrown if the root directory could not be found.

getSize

public long getSize()
Description copied from interface: FileSystem
Retrieves the size of the filesystem in bytes.

Specified by:
getSize in interface FileSystem
Returns:
The size of the filesystem or -1 if not supported. The filesystem should report if it supports this call via the infomap retrieveable by getInfo(). The key to use for retrieveal is FSInfo_HasSizeInformation

getFreeSpace

public long getFreeSpace()
Description copied from interface: FileSystem
Retrieves the free space available.

Specified by:
getFreeSpace in interface FileSystem
Returns:
The free space avaliable in bytes or -1 if not supported. The filesystem should report if it supports this call via the infomap retrieveable by getInfo(). The key to use for retrieveal is FSInfo_HasFreeSpaceInformation.

getNode

public Node getNode(String path)
             throws FileNotFoundException
Specified by:
getNode in interface FileSystem
Throws:
FileNotFoundException

close

public void close()
           throws IOException
Specified by:
close in interface FileSystem
Throws:
IOException


Copyright © 2011. All Rights Reserved.