dk.apaq.vfs.impl.layered
Class LayeredFileSystem

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

public class LayeredFileSystem
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
LayeredFileSystem(FileSystem layerForFilesystem)
           
 
Method Summary
 void addLayer(Path injectPath, Directory directory)
           
 void close()
           
 long getFreeSpace()
          Retrieves the free space available.
 Map getInfo()
          Retrieves a list of information about the filesystem.
protected  List<Directory> getLayers(Path path)
           
 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

LayeredFileSystem

public LayeredFileSystem(FileSystem layerForFilesystem)
Method Detail

addLayer

public void addLayer(Path injectPath,
                     Directory directory)

getLayers

protected List<Directory> getLayers(Path path)

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.