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 TypeMethodDescriptionvoid
closeFile
(byte[] handle) void
createSymbolicLink
(String link, String target) boolean
fileExists
(String path) getCanonicalPath
(String path) getDefaultPath
(String username) getFileAttributes
(byte[] handle) getFileAttributes
(String path) getRealPath
(String path) getVFSPermission
(String path) boolean
makeDirectory
(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) void
removeDirectory
(String path) void
removeFile
(String path) void
renameFile
(String oldpath, String newpath) void
setFileAttributes
(byte[] handle, FileAttributes attrs) void
setFileAttributes
(String path, FileAttributes attrs) static void
setPermissionHandler
(VFSPermissionHandler permissionHandler) static boolean
startsWithIgnoreCase
(String str, String with) static String
translateCanonicalPath
(String path, String securemount) static String
translateNFSPath
(String nfspath) static String
translateVFSPath
(String vfspath) static String
translateVFSPath
(String vfspath, String vfscwd) void
verifyPermissions
(String username, String path, String permissions) void
writeFile
(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:
makeDirectory
in classNativeFileSystemProvider
- Parameters:
path
-- Returns:
- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
getVFSPermission
- Parameters:
path
-- Returns:
- Throws:
FileNotFoundException
IOException
-
getFileAttributes
- Specified by:
getFileAttributes
in classNativeFileSystemProvider
- Parameters:
handle
-- Returns:
- Throws:
IOException
InvalidHandleException
-
getFileAttributes
- Specified by:
getFileAttributes
in classNativeFileSystemProvider
- Parameters:
path
-- Returns:
- Throws:
IOException
FileNotFoundException
-
openDirectory
public byte[] openDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
openDirectory
in classNativeFileSystemProvider
- Parameters:
path
-- Returns:
- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
readDirectory
public SftpFile[] readDirectory(byte[] handle) throws InvalidHandleException, EOFException, IOException - Specified by:
readDirectory
in classNativeFileSystemProvider
- Parameters:
handle
-- Returns:
- Throws:
InvalidHandleException
EOFException
IOException
EOFException
-
openFile
public byte[] openFile(String path, UnsignedInteger32 flags, FileAttributes attrs) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
openFile
in classNativeFileSystemProvider
- Parameters:
path
-flags
-attrs
-- Returns:
- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
readFile
public byte[] readFile(byte[] handle, UnsignedInteger64 offset, UnsignedInteger32 len) throws InvalidHandleException, EOFException, IOException - Specified by:
readFile
in classNativeFileSystemProvider
- Parameters:
handle
-offset
-len
-- Returns:
- Throws:
InvalidHandleException
EOFException
IOException
-
writeFile
public void writeFile(byte[] handle, UnsignedInteger64 offset, byte[] data, int off, int len) throws InvalidHandleException, IOException - Specified by:
writeFile
in classNativeFileSystemProvider
- Parameters:
handle
-offset
-data
-off
-len
-- Throws:
InvalidHandleException
IOException
-
closeFile
- Specified by:
closeFile
in classNativeFileSystemProvider
- Parameters:
handle
-- Throws:
InvalidHandleException
IOException
-
removeFile
public void removeFile(String path) throws PermissionDeniedException, IOException, FileNotFoundException - Specified by:
removeFile
in classNativeFileSystemProvider
- Parameters:
path
-- Throws:
PermissionDeniedException
IOException
FileNotFoundException
-
renameFile
public void renameFile(String oldpath, String newpath) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
renameFile
in classNativeFileSystemProvider
- Parameters:
oldpath
-newpath
-- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
removeDirectory
public void removeDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
removeDirectory
in classNativeFileSystemProvider
- Parameters:
path
-- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
setFileAttributes
public void setFileAttributes(String path, FileAttributes attrs) throws PermissionDeniedException, IOException, FileNotFoundException - Specified by:
setFileAttributes
in classNativeFileSystemProvider
- Parameters:
path
-attrs
-- Throws:
PermissionDeniedException
IOException
FileNotFoundException
-
setFileAttributes
public void setFileAttributes(byte[] handle, FileAttributes attrs) throws PermissionDeniedException, IOException, InvalidHandleException - Specified by:
setFileAttributes
in classNativeFileSystemProvider
- Parameters:
handle
-attrs
-- Throws:
PermissionDeniedException
IOException
InvalidHandleException
-
readSymbolicLink
public SftpFile readSymbolicLink(String path) throws UnsupportedFileOperationException, FileNotFoundException, IOException, PermissionDeniedException - Specified by:
readSymbolicLink
in classNativeFileSystemProvider
- Parameters:
path
-- Returns:
- Throws:
UnsupportedFileOperationException
FileNotFoundException
IOException
PermissionDeniedException
-
createSymbolicLink
public void createSymbolicLink(String link, String target) throws UnsupportedFileOperationException, FileNotFoundException, IOException, PermissionDeniedException - Specified by:
createSymbolicLink
in classNativeFileSystemProvider
- Parameters:
link
-target
-- Throws:
UnsupportedFileOperationException
FileNotFoundException
IOException
PermissionDeniedException
-
fileExists
- Specified by:
fileExists
in classNativeFileSystemProvider
- Parameters:
path
-- Returns:
- Throws:
IOException
FileNotFoundException
-
getDefaultPath
- Specified by:
getDefaultPath
in classNativeFileSystemProvider
- Throws:
FileNotFoundException
-
getCanonicalPath
- Specified by:
getCanonicalPath
in classNativeFileSystemProvider
- Parameters:
path
-- Returns:
- Throws:
IOException
FileNotFoundException
-
getRealPath
- Specified by:
getRealPath
in classNativeFileSystemProvider
- Parameters:
path
-- Returns:
- Throws:
FileNotFoundException
-
verifyPermissions
public void verifyPermissions(String username, String path, String permissions) throws PermissionDeniedException, FileNotFoundException, IOException - Specified by:
verifyPermissions
in classNativeFileSystemProvider
- Parameters:
username
-path
-permissions
-- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-