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