Class NativeFileSystemFactory
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.file.nativefs.NativeFileSystemFactory
- All Implemented Interfaces:
FileSystemFactory
Native file system factory. It uses the OS file system.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
static final String
static final NativeFileSystemFactory
private String
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFileSystem
(SessionContext session) Create user specific file system.getUserHomeDir
(SessionContext session) boolean
Should the home directories be created automaticallyvoid
setCreateHome
(boolean createHome) Set if the home directories be created automaticallyvoid
setUsersHomeDir
(String usersHomeDir) Set the root location where users home is to be created
-
Field Details
-
DEFAULT_USERS_HOME
-
INSTANCE
-
createHome
private boolean createHome -
usersHomeDir
-
-
Constructor Details
-
NativeFileSystemFactory
public NativeFileSystemFactory() -
NativeFileSystemFactory
public NativeFileSystemFactory(boolean createHome)
-
-
Method Details
-
getUsersHomeDir
- Returns:
- The root location where users home is to be created - never
null
/empty.
-
setUsersHomeDir
Set the root location where users home is to be created- Parameters:
usersHomeDir
- The root location where users home is to be created - nevernull
/empty.- See Also:
-
isCreateHome
public boolean isCreateHome()Should the home directories be created automatically- Returns:
true
if the file system will create the home directory if not available
-
setCreateHome
public void setCreateHome(boolean createHome) Set if the home directories be created automatically- Parameters:
createHome
-true
if the file system should create the home directory automatically if not available- See Also:
-
getUserHomeDir
- 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
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
-