dk.apaq.vfs.impl.cifs
Class CifsFileSystem

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

public class CifsFileSystem
extends Object
implements FileSystem

Author:
mzk
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
CifsFileSystem(String url)
           
CifsFileSystem(String server, String share)
           
 
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.
static String[] getServers(String workgroup)
           
static String[] getShares(String server)
           
 long getSize()
          Retrieves the size of the filesystem in bytes.
static String[] getWorkgroups()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CifsFileSystem

public CifsFileSystem(String server,
                      String share)
               throws MalformedURLException,
                      jcifs.smb.SmbException
Throws:
MalformedURLException
jcifs.smb.SmbException

CifsFileSystem

public CifsFileSystem(String url)
               throws MalformedURLException,
                      jcifs.smb.SmbException
Throws:
MalformedURLException
jcifs.smb.SmbException
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.

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.

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.

getWorkgroups

public static String[] getWorkgroups()
                              throws IOException
Throws:
IOException

getServers

public static String[] getServers(String workgroup)
                           throws IOException
Throws:
IOException

getShares

public static String[] getShares(String server)
                          throws IOException
Throws:
IOException

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.