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 class
SftpFileSystem.DefaultGroupPrincipal
static class
SftpFileSystem.DefaultUserPrincipal
static class
SftpFileSystem.DefaultUserPrincipalLookupService
private class
SftpFileSystem.Wrapper
-
Field Summary
Fields Modifier and Type Field Description private ClientSession
clientSession
private SftpPath
defaultDir
private SftpClientFactory
factory
private java.lang.String
id
private java.util.Queue<SftpClient>
pool
private int
readBufferSize
private SftpVersionSelector
selector
private java.util.List<java.nio.file.FileStore>
stores
private java.util.Set<java.lang.String>
supportedViews
static java.util.NavigableSet<java.lang.String>
UNIVERSAL_SUPPORTED_VIEWS
private int
version
private java.lang.ThreadLocal<SftpFileSystem.Wrapper>
wrappers
private int
writeBufferSize
-
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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected SftpPath
create(java.lang.String root, java.util.List<java.lang.String> names)
SftpClient
getClient()
ClientSession
getClientSession()
SftpPath
getDefaultDir()
java.util.List<java.nio.file.FileStore>
getFileStores()
java.lang.String
getId()
int
getReadBufferSize()
ClientSession
getSession()
SftpVersionSelector
getSftpVersionSelector()
java.nio.file.attribute.UserPrincipalLookupService
getUserPrincipalLookupService()
int
getVersion()
int
getWriteBufferSize()
boolean
isOpen()
SftpFileSystemProvider
provider()
void
setReadBufferSize(int size)
void
setWriteBufferSize(int size)
java.util.Set<java.lang.String>
supportedFileAttributeViews()
java.lang.String
toString()
-
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
-
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) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getSftpVersionSelector
public final SftpVersionSelector getSftpVersionSelector()
-
getId
public final java.lang.String getId()
-
getVersion
public final int getVersion()
-
provider
public SftpFileSystemProvider provider()
- Overrides:
provider
in classBaseFileSystem<SftpPath>
-
getFileStores
public java.util.List<java.nio.file.FileStore> getFileStores()
- Overrides:
getFileStores
in 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:
create
in classBaseFileSystem<SftpPath>
-
getClientSession
public ClientSession getClientSession()
- Specified by:
getClientSession
in interfaceClientSessionHolder
- Returns:
- The underlying
ClientSession
used
-
getSession
public ClientSession getSession()
- Specified by:
getSession
in interfaceSessionHolder<ClientSession>
-
getClient
public SftpClient getClient() throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.nio.file.FileSystem
- Throws:
java.io.IOException
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in classjava.nio.file.FileSystem
-
supportedFileAttributeViews
public java.util.Set<java.lang.String> supportedFileAttributeViews()
- Specified by:
supportedFileAttributeViews
in classjava.nio.file.FileSystem
-
getUserPrincipalLookupService
public java.nio.file.attribute.UserPrincipalLookupService getUserPrincipalLookupService()
- Specified by:
getUserPrincipalLookupService
in classjava.nio.file.FileSystem
-
getDefaultDir
public SftpPath getDefaultDir()
- Overrides:
getDefaultDir
in classBaseFileSystem<SftpPath>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-