Class SftpFileSystem
java.lang.Object
org.apache.commons.vfs2.provider.AbstractVfsComponent
org.apache.commons.vfs2.provider.AbstractFileSystem
org.apache.commons.vfs2.provider.sftp.SftpFileSystem
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- FileSystem,- VfsComponent
Represents the files on an SFTP server.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedSftpFileSystem(GenericFileName rootName, com.jcraft.jsch.Session session, FileSystemOptions fileSystemOptions) Constructs a new instance.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddCapabilities(Collection<Capability> caps) Adds the capabilities of this file system.protected FileObjectcreateFile(AbstractFileName name) Creates a file object.protected voidCloses the underlying link used to access the files.protected com.jcraft.jsch.ChannelSftpReturns an SFTP channel to the server.int[]Gets the (numeric) group IDs.doubleLast modification time is only an int and in seconds, thus can be off by 999.intgetUId()Gets the (numeric) group IDs.booleanTests whether the exec channel is disabled.protected voidputChannel(com.jcraft.jsch.ChannelSftp channelSftp) Returns a channel to the pool.Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileSystemaddJunction, addListener, close, closeCommunicationLink, decorateFileObject, doReplicateFile, fireFileChanged, fireFileCreated, fireFileDeleted, getAttribute, getFileFromCache, getFileSystemManager, getFileSystemOptions, getParentLayer, getRoot, getRootName, getRootURI, hasCapability, init, isOpen, isReleaseable, notifyAllStreamsClosed, putFileToCache, removeFileFromCache, removeJunction, removeListener, replicateFile, resolveFile, resolveFile, setAttributeMethods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponentgetContext, getLogger, setContext, setLogger
- 
Constructor Details- 
SftpFileSystemprotected SftpFileSystem(GenericFileName rootName, com.jcraft.jsch.Session session, FileSystemOptions fileSystemOptions) Constructs a new instance.- Parameters:
- rootName- The root file name of this file system.
- session- The session.
- fileSystemOptions- Options to build this file system.
 
 
- 
- 
Method Details- 
addCapabilitiesAdds the capabilities of this file system.- Specified by:
- addCapabilitiesin class- AbstractFileSystem
- Parameters:
- caps- collections of Capabilities, can be immutable.
 
- 
createFileCreates a file object. This method is called only if the requested file is not cached.- Specified by:
- createFilein class- AbstractFileSystem
- Parameters:
- name- name referencing the new file.
- Returns:
- new created FileObject.
- Throws:
- FileSystemException
 
- 
doCloseCommunicationLinkDescription copied from class:AbstractFileSystemCloses the underlying link used to access the files.- Overrides:
- doCloseCommunicationLinkin class- AbstractFileSystem
 
- 
getChannelReturns an SFTP channel to the server.- Returns:
- new or reused channel, never null.
- Throws:
- FileSystemException- if a session cannot be created.
- IOException- if an I/O error is detected.
 
- 
getGroupsIdsGets the (numeric) group IDs.- Returns:
- the (numeric) group IDs.
- Throws:
- com.jcraft.jsch.JSchException- If a problem occurs while retrieving the group IDs.
- IOException- if an I/O error is detected.
- Since:
- 2.1
 
- 
getLastModTimeAccuracyLast modification time is only an int and in seconds, thus can be off by 999.- Specified by:
- getLastModTimeAccuracyin interface- FileSystem
- Overrides:
- getLastModTimeAccuracyin class- AbstractFileSystem
- Returns:
- 1000
 
- 
getUIdGets the (numeric) group IDs.- Returns:
- The numeric user ID
- Throws:
- com.jcraft.jsch.JSchException- If a problem occurs while retrieving the group ID.
- IOException- if an I/O error is detected.
- Since:
- 2.1
 
- 
isExecDisabledTests whether the exec channel is disabled.- Returns:
- Whether the exec channel is disabled.
- See Also:
 
- 
putChannelReturns a channel to the pool.- Parameters:
- channelSftp- the SFTP channel.
 
 
-