dk.apaq.vfs.impl.sftp
Class SftpFileSystem

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

public class SftpFileSystem
extends Object
implements FileSystem

Author:
krog
See Also:
Serialized Form

Field Summary
protected  ch.ethz.ssh2.SFTPv3Client sftpc
           
 
Fields inherited from interface dk.apaq.vfs.FileSystem
FSInfo_Description, FSInfo_HasFreeSpaceInformation, FSInfo_HasSizeInformation, FSInfo_Name, FSInfo_Version
 
Constructor Summary
SftpFileSystem(String host, int port, String user, String password)
           
SftpFileSystem(String host, int port, String user, String password, int timeout)
           
 
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
 

Field Detail

sftpc

protected ch.ethz.ssh2.SFTPv3Client sftpc
Constructor Detail

SftpFileSystem

public SftpFileSystem(String host,
                      int port,
                      String user,
                      String password)
               throws IOException
Throws:
IOException

SftpFileSystem

public SftpFileSystem(String host,
                      int port,
                      String user,
                      String password,
                      int timeout)
               throws IOException
Throws:
IOException
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.