Package com.sshtools.daemon.platform
Class NativeFileSystemProvider
java.lang.Object
com.sshtools.daemon.platform.NativeFileSystemProvider
- Direct Known Subclasses:
VirtualFileSystem
- Version:
- $Revision: 1.13 $
- Author:
- $author$
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
closeFile
(byte[] handle) abstract void
createSymbolicLink
(String link, String target) abstract boolean
fileExists
(String path) abstract String
getCanonicalPath
(String path) abstract String
getDefaultPath
(String username) abstract FileAttributes
getFileAttributes
(byte[] handle) abstract FileAttributes
getFileAttributes
(String path) static NativeFileSystemProvider
abstract String
getRealPath
(String path) abstract boolean
makeDirectory
(String path) abstract byte[]
openDirectory
(String path) abstract byte[]
openFile
(String path, UnsignedInteger32 flags, FileAttributes attrs) abstract SftpFile[]
readDirectory
(byte[] handle) abstract byte[]
readFile
(byte[] handle, UnsignedInteger64 offset, UnsignedInteger32 len) abstract SftpFile
readSymbolicLink
(String path) abstract void
removeDirectory
(String path) abstract void
removeFile
(String path) abstract void
renameFile
(String oldpath, String newpath) abstract void
setFileAttributes
(byte[] handle, FileAttributes attrs) abstract void
setFileAttributes
(String path, FileAttributes attrs) abstract void
verifyPermissions
(String username, String path, String permissions) abstract void
writeFile
(byte[] handle, UnsignedInteger64 offset, byte[] data, int off, int len)
-
Field Details
-
OPEN_READ
public static final int OPEN_READ- See Also:
-
OPEN_WRITE
public static final int OPEN_WRITE- See Also:
-
OPEN_APPEND
public static final int OPEN_APPEND- See Also:
-
OPEN_CREATE
public static final int OPEN_CREATE- See Also:
-
OPEN_TRUNCATE
public static final int OPEN_TRUNCATE- See Also:
-
OPEN_EXCLUSIVE
public static final int OPEN_EXCLUSIVE- See Also:
-
-
Constructor Details
-
NativeFileSystemProvider
public NativeFileSystemProvider()
-
-
Method Details
-
fileExists
- Parameters:
path
-- Returns:
- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
getCanonicalPath
- Parameters:
path
-- Returns:
- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
getRealPath
- Parameters:
path
-- Returns:
- Throws:
FileNotFoundException
-
makeDirectory
public abstract boolean makeDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
path
-- Returns:
- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
getFileAttributes
public abstract FileAttributes getFileAttributes(String path) throws IOException, FileNotFoundException - Parameters:
path
-- Returns:
- Throws:
IOException
FileNotFoundException
-
getFileAttributes
public abstract FileAttributes getFileAttributes(byte[] handle) throws IOException, InvalidHandleException - Parameters:
handle
-- Returns:
- Throws:
IOException
InvalidHandleException
-
openDirectory
public abstract byte[] openDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
path
-- Returns:
- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
readDirectory
public abstract SftpFile[] readDirectory(byte[] handle) throws InvalidHandleException, EOFException, IOException - Parameters:
handle
-- Returns:
- Throws:
InvalidHandleException
EOFException
IOException
-
openFile
public abstract byte[] openFile(String path, UnsignedInteger32 flags, FileAttributes attrs) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
path
-flags
-attrs
-- Returns:
- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
readFile
public abstract byte[] readFile(byte[] handle, UnsignedInteger64 offset, UnsignedInteger32 len) throws InvalidHandleException, EOFException, IOException - Parameters:
handle
-offset
-len
-- Returns:
- Throws:
InvalidHandleException
EOFException
IOException
-
writeFile
public abstract void writeFile(byte[] handle, UnsignedInteger64 offset, byte[] data, int off, int len) throws InvalidHandleException, IOException - Parameters:
handle
-offset
-data
-off
-len
-- Throws:
InvalidHandleException
IOException
-
closeFile
- Parameters:
handle
-- Throws:
InvalidHandleException
IOException
-
removeFile
public abstract void removeFile(String path) throws PermissionDeniedException, IOException, FileNotFoundException - Parameters:
path
-- Throws:
PermissionDeniedException
IOException
FileNotFoundException
-
renameFile
public abstract void renameFile(String oldpath, String newpath) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
oldpath
-newpath
-- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
removeDirectory
public abstract void removeDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
path
-- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
setFileAttributes
public abstract void setFileAttributes(String path, FileAttributes attrs) throws PermissionDeniedException, IOException, FileNotFoundException - Parameters:
path
-attrs
-- Throws:
PermissionDeniedException
IOException
FileNotFoundException
-
setFileAttributes
public abstract void setFileAttributes(byte[] handle, FileAttributes attrs) throws PermissionDeniedException, IOException, InvalidHandleException - Parameters:
handle
-attrs
-- Throws:
PermissionDeniedException
IOException
InvalidHandleException
-
readSymbolicLink
public abstract SftpFile readSymbolicLink(String path) throws UnsupportedFileOperationException, FileNotFoundException, IOException, PermissionDeniedException - Parameters:
path
-- Returns:
- Throws:
UnsupportedFileOperationException
FileNotFoundException
IOException
PermissionDeniedException
-
createSymbolicLink
public abstract void createSymbolicLink(String link, String target) throws UnsupportedFileOperationException, FileNotFoundException, IOException, PermissionDeniedException - Parameters:
link
-target
-- Throws:
UnsupportedFileOperationException
FileNotFoundException
IOException
PermissionDeniedException
-
getDefaultPath
- Throws:
FileNotFoundException
-
verifyPermissions
public abstract void verifyPermissions(String username, String path, String permissions) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
username
-path
-permissions
-- Throws:
PermissionDeniedException
FileNotFoundException
IOException
-
getInstance
- Returns:
-