Class VirtualFileSystemFactory
- java.lang.Object
-
- org.apache.sshd.common.file.virtualfs.VirtualFileSystemFactory
-
- All Implemented Interfaces:
FileSystemFactory
public class VirtualFileSystemFactory extends java.lang.Object implements FileSystemFactory
SSHd file system factory to reduce the visibility to a physical folder.
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.file.PathdefaultHomeDirprivate java.util.Map<java.lang.String,java.nio.file.Path>homeDirs
-
Constructor Summary
Constructors Constructor Description VirtualFileSystemFactory()VirtualFileSystemFactory(java.nio.file.Path defaultHomeDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.file.FileSystemcreateFileSystem(SessionContext session)Create user specific file system.java.nio.file.PathgetDefaultHomeDir()java.nio.file.PathgetUserHomeDir(java.lang.String userName)java.nio.file.PathgetUserHomeDir(SessionContext session)voidsetDefaultHomeDir(java.nio.file.Path defaultHomeDir)voidsetUserHomeDir(java.lang.String userName, java.nio.file.Path userHomeDir)
-
-
-
Method Detail
-
setDefaultHomeDir
public void setDefaultHomeDir(java.nio.file.Path defaultHomeDir)
-
getDefaultHomeDir
public java.nio.file.Path getDefaultHomeDir()
-
setUserHomeDir
public void setUserHomeDir(java.lang.String userName, java.nio.file.Path userHomeDir)
-
getUserHomeDir
public java.nio.file.Path getUserHomeDir(java.lang.String userName)
-
getUserHomeDir
public java.nio.file.Path getUserHomeDir(SessionContext session) throws java.io.IOException
- Specified by:
getUserHomeDirin interfaceFileSystemFactory- Parameters:
session- The session created for the user- Returns:
- The recommended user home directory -
nullif none - Throws:
java.io.IOException- If failed to resolve user's home directory
-
createFileSystem
public java.nio.file.FileSystem createFileSystem(SessionContext session) throws java.io.IOException
Description copied from interface:FileSystemFactoryCreate user specific file system.- Specified by:
createFileSystemin interfaceFileSystemFactory- Parameters:
session- The session created for the user- Returns:
- The current
FileSystemfor the provided session - Throws:
java.io.IOException- if the file system can not be created
-
-