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.Path
defaultHomeDir
private 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 protected java.nio.file.Path
computeRootDir(Session session)
java.nio.file.FileSystem
createFileSystem(Session session)
Create user specific file system.java.nio.file.Path
getDefaultHomeDir()
java.nio.file.Path
getUserHomeDir(java.lang.String userName)
void
setDefaultHomeDir(java.nio.file.Path defaultHomeDir)
void
setUserHomeDir(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)
-
createFileSystem
public java.nio.file.FileSystem createFileSystem(Session session) throws java.io.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:
java.io.IOException
- if the filesystem can not be created
-
computeRootDir
protected java.nio.file.Path computeRootDir(Session session) throws java.io.IOException
- Throws:
java.io.IOException
-
-