Package org.apache.sshd.sftp.client.fs
Class SftpFileSystem
- java.lang.Object
-
- java.nio.file.FileSystem
-
- org.apache.sshd.common.file.util.BaseFileSystem<SftpPath>
-
- org.apache.sshd.sftp.client.fs.SftpFileSystem
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ClientSessionHolder,SessionContextHolder,SessionHolder<ClientSession>
public class SftpFileSystem extends BaseFileSystem<SftpPath> implements SessionHolder<ClientSession>, ClientSessionHolder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSftpFileSystem.DefaultGroupPrincipalstatic classSftpFileSystem.DefaultUserPrincipalstatic classSftpFileSystem.DefaultUserPrincipalLookupServiceprivate classSftpFileSystem.Wrapper
-
Field Summary
Fields Modifier and Type Field Description private ClientSessionclientSessionprivate SftpPathdefaultDirprivate SftpErrorDataHandlererrorDataHandlerprivate SftpClientFactoryfactoryprivate java.lang.Stringidprivate java.util.Queue<SftpClient>poolprivate intreadBufferSizeprivate SftpVersionSelectorselectorprivate java.util.List<java.nio.file.FileStore>storesprivate java.util.Set<java.lang.String>supportedViewsstatic java.util.NavigableSet<java.lang.String>UNIVERSAL_SUPPORTED_VIEWSprivate intversionprivate java.lang.ThreadLocal<SftpFileSystem.Wrapper>wrappersprivate intwriteBufferSize-
Fields inherited from class org.apache.sshd.common.file.util.BaseFileSystem
log
-
-
Constructor Summary
Constructors Constructor Description SftpFileSystem(SftpFileSystemProvider provider, java.lang.String id, ClientSession session, SftpClientFactory factory, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected SftpPathcreate(java.lang.String root, java.util.List<java.lang.String> names)SftpClientgetClient()ClientSessiongetClientSession()SftpPathgetDefaultDir()java.util.List<java.nio.file.FileStore>getFileStores()java.lang.StringgetId()intgetReadBufferSize()ClientSessiongetSession()SftpErrorDataHandlergetSftpErrorDataHandler()SftpVersionSelectorgetSftpVersionSelector()java.nio.file.attribute.UserPrincipalLookupServicegetUserPrincipalLookupService()intgetVersion()intgetWriteBufferSize()booleanisOpen()SftpFileSystemProviderprovider()voidsetReadBufferSize(int size)voidsetWriteBufferSize(int size)java.util.Set<java.lang.String>supportedFileAttributeViews()java.lang.StringtoString()-
Methods inherited from class org.apache.sshd.common.file.util.BaseFileSystem
appendDedupSep, create, create, getPath, getPathMatcher, getRootDirectories, getSeparator, globToRegex, isReadOnly, newWatchService
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
-
-
-
Field Detail
-
UNIVERSAL_SUPPORTED_VIEWS
public static final java.util.NavigableSet<java.lang.String> UNIVERSAL_SUPPORTED_VIEWS
-
id
private final java.lang.String id
-
clientSession
private final ClientSession clientSession
-
factory
private final SftpClientFactory factory
-
selector
private final SftpVersionSelector selector
-
errorDataHandler
private final SftpErrorDataHandler errorDataHandler
-
pool
private final java.util.Queue<SftpClient> pool
-
wrappers
private final java.lang.ThreadLocal<SftpFileSystem.Wrapper> wrappers
-
version
private final int version
-
supportedViews
private final java.util.Set<java.lang.String> supportedViews
-
defaultDir
private SftpPath defaultDir
-
readBufferSize
private int readBufferSize
-
writeBufferSize
private int writeBufferSize
-
stores
private final java.util.List<java.nio.file.FileStore> stores
-
-
Constructor Detail
-
SftpFileSystem
public SftpFileSystem(SftpFileSystemProvider provider, java.lang.String id, ClientSession session, SftpClientFactory factory, SftpVersionSelector selector, SftpErrorDataHandler errorDataHandler) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getSftpVersionSelector
public final SftpVersionSelector getSftpVersionSelector()
-
getSftpErrorDataHandler
public SftpErrorDataHandler getSftpErrorDataHandler()
-
getId
public final java.lang.String getId()
-
getVersion
public final int getVersion()
-
provider
public SftpFileSystemProvider provider()
- Overrides:
providerin classBaseFileSystem<SftpPath>
-
getFileStores
public java.util.List<java.nio.file.FileStore> getFileStores()
- Overrides:
getFileStoresin classBaseFileSystem<SftpPath>
-
getReadBufferSize
public int getReadBufferSize()
-
setReadBufferSize
public void setReadBufferSize(int size)
-
getWriteBufferSize
public int getWriteBufferSize()
-
setWriteBufferSize
public void setWriteBufferSize(int size)
-
create
protected SftpPath create(java.lang.String root, java.util.List<java.lang.String> names)
- Specified by:
createin classBaseFileSystem<SftpPath>
-
getClientSession
public ClientSession getClientSession()
- Specified by:
getClientSessionin interfaceClientSessionHolder- Returns:
- The underlying
ClientSessionused
-
getSession
public ClientSession getSession()
- Specified by:
getSessionin interfaceSessionHolder<ClientSession>
-
getClient
public SftpClient getClient() throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classjava.nio.file.FileSystem- Throws:
java.io.IOException
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin classjava.nio.file.FileSystem
-
supportedFileAttributeViews
public java.util.Set<java.lang.String> supportedFileAttributeViews()
- Specified by:
supportedFileAttributeViewsin classjava.nio.file.FileSystem
-
getUserPrincipalLookupService
public java.nio.file.attribute.UserPrincipalLookupService getUserPrincipalLookupService()
- Specified by:
getUserPrincipalLookupServicein classjava.nio.file.FileSystem
-
getDefaultDir
public SftpPath getDefaultDir()
- Overrides:
getDefaultDirin classBaseFileSystem<SftpPath>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-