com.maverick.sshd.vfs
Interface VFSPermissionHandler


public interface VFSPermissionHandler

By default the VirtualFileSystem provides access to all files and folders but this interface can be implemented to provide for custom permission handling. Simply define an implementation and set the "com.maverick.sshd.vfs.VFSPermissionHandler" system property to the fully qualified class name of your class.

Author:
Lee David Painter

Method Summary
 boolean canExecute(java.lang.String username, java.lang.String group, java.lang.String path)
          Return true if the user can execute the file or list the directory.
 boolean canRead(java.lang.String username, java.lang.String group, java.lang.String path)
          Return true if the user can read the file.
 boolean canWrite(java.lang.String username, java.lang.String group, java.lang.String path)
          Return true if the user can write to the file.
 SftpFileAttributes getPermissions(java.lang.String username, java.lang.String path)
          Get the files attributes.
 java.lang.String getVFSHomeDirectory(java.lang.String username)
          Get the VFS home directory for a user.
 

Method Detail

canRead

public boolean canRead(java.lang.String username,
                       java.lang.String group,
                       java.lang.String path)
Return true if the user can read the file.

Parameters:
username -
group -
path -
Returns:
boolean

canWrite

public boolean canWrite(java.lang.String username,
                        java.lang.String group,
                        java.lang.String path)
Return true if the user can write to the file.

Parameters:
username -
group -
path -
Returns:
boolean

canExecute

public boolean canExecute(java.lang.String username,
                          java.lang.String group,
                          java.lang.String path)
Return true if the user can execute the file or list the directory.

Parameters:
username -
group -
path -
Returns:
boolean

getPermissions

public SftpFileAttributes getPermissions(java.lang.String username,
                                         java.lang.String path)
                                  throws java.io.FileNotFoundException
Get the files attributes.

Parameters:
path -
Returns:
SftpFileAttributes
Throws:
java.io.FileNotFoundException

getVFSHomeDirectory

public java.lang.String getVFSHomeDirectory(java.lang.String username)
                                     throws java.io.FileNotFoundException
Get the VFS home directory for a user.

Parameters:
username -
Returns:
String
Throws:
java.io.FileNotFoundException


Copyright © 2003-2008 SSHTools LTD. All Rights Reserved.