dk.apaq.vfs.impl.sftp
Class SftpFileSystem
java.lang.Object
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
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sftpc
protected ch.ethz.ssh2.SFTPv3Client sftpc
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
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.