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 intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcloseFile(byte[] handle) abstract voidcreateSymbolicLink(String link, String target) abstract booleanfileExists(String path) abstract StringgetCanonicalPath(String path) abstract StringgetDefaultPath(String username) abstract FileAttributesgetFileAttributes(byte[] handle) abstract FileAttributesgetFileAttributes(String path) static NativeFileSystemProviderabstract StringgetRealPath(String path) abstract booleanmakeDirectory(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 SftpFilereadSymbolicLink(String path) abstract voidremoveDirectory(String path) abstract voidremoveFile(String path) abstract voidrenameFile(String oldpath, String newpath) abstract voidsetFileAttributes(byte[] handle, FileAttributes attrs) abstract voidsetFileAttributes(String path, FileAttributes attrs) abstract voidverifyPermissions(String username, String path, String permissions) abstract voidwriteFile(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:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
getCanonicalPath
- Parameters:
path-- Returns:
- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
getRealPath
- Parameters:
path-- Returns:
- Throws:
FileNotFoundException
-
makeDirectory
public abstract boolean makeDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
path-- Returns:
- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
getFileAttributes
public abstract FileAttributes getFileAttributes(String path) throws IOException, FileNotFoundException - Parameters:
path-- Returns:
- Throws:
IOExceptionFileNotFoundException
-
getFileAttributes
public abstract FileAttributes getFileAttributes(byte[] handle) throws IOException, InvalidHandleException - Parameters:
handle-- Returns:
- Throws:
IOExceptionInvalidHandleException
-
openDirectory
public abstract byte[] openDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
path-- Returns:
- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
readDirectory
public abstract SftpFile[] readDirectory(byte[] handle) throws InvalidHandleException, EOFException, IOException - Parameters:
handle-- Returns:
- Throws:
InvalidHandleExceptionEOFExceptionIOException
-
openFile
public abstract byte[] openFile(String path, UnsignedInteger32 flags, FileAttributes attrs) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
path-flags-attrs-- Returns:
- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
readFile
public abstract byte[] readFile(byte[] handle, UnsignedInteger64 offset, UnsignedInteger32 len) throws InvalidHandleException, EOFException, IOException - Parameters:
handle-offset-len-- Returns:
- Throws:
InvalidHandleExceptionEOFExceptionIOException
-
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:
InvalidHandleExceptionIOException
-
closeFile
- Parameters:
handle-- Throws:
InvalidHandleExceptionIOException
-
removeFile
public abstract void removeFile(String path) throws PermissionDeniedException, IOException, FileNotFoundException - Parameters:
path-- Throws:
PermissionDeniedExceptionIOExceptionFileNotFoundException
-
renameFile
public abstract void renameFile(String oldpath, String newpath) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
oldpath-newpath-- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
removeDirectory
public abstract void removeDirectory(String path) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
path-- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
setFileAttributes
public abstract void setFileAttributes(String path, FileAttributes attrs) throws PermissionDeniedException, IOException, FileNotFoundException - Parameters:
path-attrs-- Throws:
PermissionDeniedExceptionIOExceptionFileNotFoundException
-
setFileAttributes
public abstract void setFileAttributes(byte[] handle, FileAttributes attrs) throws PermissionDeniedException, IOException, InvalidHandleException - Parameters:
handle-attrs-- Throws:
PermissionDeniedExceptionIOExceptionInvalidHandleException
-
readSymbolicLink
public abstract SftpFile readSymbolicLink(String path) throws UnsupportedFileOperationException, FileNotFoundException, IOException, PermissionDeniedException - Parameters:
path-- Returns:
- Throws:
UnsupportedFileOperationExceptionFileNotFoundExceptionIOExceptionPermissionDeniedException
-
createSymbolicLink
public abstract void createSymbolicLink(String link, String target) throws UnsupportedFileOperationException, FileNotFoundException, IOException, PermissionDeniedException - Parameters:
link-target-- Throws:
UnsupportedFileOperationExceptionFileNotFoundExceptionIOExceptionPermissionDeniedException
-
getDefaultPath
- Throws:
FileNotFoundException
-
verifyPermissions
public abstract void verifyPermissions(String username, String path, String permissions) throws PermissionDeniedException, FileNotFoundException, IOException - Parameters:
username-path-permissions-- Throws:
PermissionDeniedExceptionFileNotFoundExceptionIOException
-
getInstance
- Returns:
-