Package com.sshtools.daemon.vfs
Class VirtualFileSystem
java.lang.Object
com.sshtools.daemon.platform.NativeFileSystemProvider
com.sshtools.daemon.vfs.VirtualFileSystem
- Version:
- $Revision: 1.32 $
- Author:
- $author$
-
Field Summary
Fields inherited from class com.sshtools.daemon.platform.NativeFileSystemProvider
OPEN_APPEND, OPEN_CREATE, OPEN_EXCLUSIVE, OPEN_READ, OPEN_TRUNCATE, OPEN_WRITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseFile(byte[] handle) voidcreateSymbolicLink(String link, String target) booleanfileExists(String path) getCanonicalPath(String path) getDefaultPath(String username) getFileAttributes(byte[] handle) getFileAttributes(String path) getRealPath(String path) getVFSPermission(String path) booleanmakeDirectory(String path) byte[]openDirectory(String path) byte[]openFile(String path, UnsignedInteger32 flags, FileAttributes attrs) SftpFile[]readDirectory(byte[] handle) byte[]readFile(byte[] handle, UnsignedInteger64 offset, UnsignedInteger32 len) readSymbolicLink(String path) voidremoveDirectory(String path) voidremoveFile(String path) voidrenameFile(String oldpath, String newpath) voidsetFileAttributes(byte[] handle, FileAttributes attrs) voidsetFileAttributes(String path, FileAttributes attrs) static voidsetPermissionHandler(VFSPermissionHandler permissionHandler) static booleanstartsWithIgnoreCase(String str, String with) static StringtranslateCanonicalPath(String path, String securemount) static StringtranslateNFSPath(String nfspath) static StringtranslateVFSPath(String vfspath) static StringtranslateVFSPath(String vfspath, String vfscwd) voidverifyPermissions(String username, String path, String permissions) voidwriteFile(byte[] handle, UnsignedInteger64 offset, byte[] data, int off, int len) Methods inherited from class com.sshtools.daemon.platform.NativeFileSystemProvider
getInstance
-
Constructor Details
-
VirtualFileSystem
Creates a new VirtualFileSystem object.- Throws:
IOException
-
-
Method Details
-
setPermissionHandler
-
startsWithIgnoreCase
- Parameters:
str-with-- Returns:
-
translateNFSPath
- Parameters:
nfspath-- Returns:
- Throws:
FileNotFoundException
-
translateVFSPath
- Parameters:
vfspath-- Returns:
- Throws:
FileNotFoundException
-
translateVFSPath
- Throws:
FileNotFoundException
-
translateCanonicalPath
public static String translateCanonicalPath(String path, String securemount) throws FileNotFoundException - Parameters:
path-securemount-- Returns:
- Throws:
FileNotFoundException
-
makeDirectory
public boolean makeDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
makeDirectoryin classNativeFileSystemProvider- Parameters:
path-- Returns:
- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
getVFSPermission
- Parameters:
path-- Returns:
- Throws:
FileNotFoundExceptionIOException
-
getFileAttributes
- Specified by:
getFileAttributesin classNativeFileSystemProvider- Parameters:
handle-- Returns:
- Throws:
IOExceptionInvalidHandleException
-
getFileAttributes
- Specified by:
getFileAttributesin classNativeFileSystemProvider- Parameters:
path-- Returns:
- Throws:
IOExceptionFileNotFoundException
-
openDirectory
public byte[] openDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
openDirectoryin classNativeFileSystemProvider- Parameters:
path-- Returns:
- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
readDirectory
public SftpFile[] readDirectory(byte[] handle) throws InvalidHandleException, EOFException, IOException - Specified by:
readDirectoryin classNativeFileSystemProvider- Parameters:
handle-- Returns:
- Throws:
InvalidHandleExceptionEOFExceptionIOException
-
openFile
public byte[] openFile(String path, UnsignedInteger32 flags, FileAttributes attrs) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
openFilein classNativeFileSystemProvider- Parameters:
path-flags-attrs-- Returns:
- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
readFile
public byte[] readFile(byte[] handle, UnsignedInteger64 offset, UnsignedInteger32 len) throws InvalidHandleException, EOFException, IOException - Specified by:
readFilein classNativeFileSystemProvider- Parameters:
handle-offset-len-- Returns:
- Throws:
InvalidHandleExceptionEOFExceptionIOException
-
writeFile
public void writeFile(byte[] handle, UnsignedInteger64 offset, byte[] data, int off, int len) throws InvalidHandleException, IOException - Specified by:
writeFilein classNativeFileSystemProvider- Parameters:
handle-offset-data-off-len-- Throws:
InvalidHandleExceptionIOException
-
closeFile
- Specified by:
closeFilein classNativeFileSystemProvider- Parameters:
handle-- Throws:
InvalidHandleExceptionIOException
-
removeFile
public void removeFile(String path) throws PermissionDeniedException, IOException, FileNotFoundException - Specified by:
removeFilein classNativeFileSystemProvider- Parameters:
path-- Throws:
PermissionDeniedExceptionIOExceptionFileNotFoundException
-
renameFile
public void renameFile(String oldpath, String newpath) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
renameFilein classNativeFileSystemProvider- Parameters:
oldpath-newpath-- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
removeDirectory
public void removeDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
removeDirectoryin classNativeFileSystemProvider- Parameters:
path-- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
setFileAttributes
public void setFileAttributes(String path, FileAttributes attrs) throws PermissionDeniedException, IOException, FileNotFoundException - Specified by:
setFileAttributesin classNativeFileSystemProvider- Parameters:
path-attrs-- Throws:
PermissionDeniedExceptionIOExceptionFileNotFoundException
-
setFileAttributes
public void setFileAttributes(byte[] handle, FileAttributes attrs) throws PermissionDeniedException, IOException, InvalidHandleException - Specified by:
setFileAttributesin classNativeFileSystemProvider- Parameters:
handle-attrs-- Throws:
PermissionDeniedExceptionIOExceptionInvalidHandleException
-
readSymbolicLink
public SftpFile readSymbolicLink(String path) throws UnsupportedFileOperationException, FileNotFoundException, IOException, PermissionDeniedException - Specified by:
readSymbolicLinkin classNativeFileSystemProvider- Parameters:
path-- Returns:
- Throws:
UnsupportedFileOperationExceptionFileNotFoundExceptionIOExceptionPermissionDeniedException
-
createSymbolicLink
public void createSymbolicLink(String link, String target) throws UnsupportedFileOperationException, FileNotFoundException, IOException, PermissionDeniedException - Specified by:
createSymbolicLinkin classNativeFileSystemProvider- Parameters:
link-target-- Throws:
UnsupportedFileOperationExceptionFileNotFoundExceptionIOExceptionPermissionDeniedException
-
fileExists
- Specified by:
fileExistsin classNativeFileSystemProvider- Parameters:
path-- Returns:
- Throws:
IOException
-
getDefaultPath
- Specified by:
getDefaultPathin classNativeFileSystemProvider- Throws:
FileNotFoundException
-
getCanonicalPath
- Specified by:
getCanonicalPathin classNativeFileSystemProvider- Parameters:
path-- Returns:
- Throws:
IOExceptionFileNotFoundException
-
getRealPath
- Specified by:
getRealPathin classNativeFileSystemProvider- Parameters:
path-- Returns:
- Throws:
FileNotFoundException
-
verifyPermissions
public void verifyPermissions(String username, String path, String permissions) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
verifyPermissionsin classNativeFileSystemProvider- Parameters:
username-path-permissions-- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-