com.sshtools.daemon.vfs
Class VirtualFileSystem
java.lang.Object
com.sshtools.daemon.platform.NativeFileSystemProvider
com.sshtools.daemon.vfs.VirtualFileSystem
public class VirtualFileSystem
- extends NativeFileSystemProvider
- Version:
- $Revision: 1.32 $
- Author:
- $author$
|
Method Summary |
void |
closeFile(byte[] handle)
|
void |
createSymbolicLink(java.lang.String link,
java.lang.String target)
|
boolean |
fileExists(java.lang.String path)
|
java.lang.String |
getCanonicalPath(java.lang.String path)
|
java.lang.String |
getDefaultPath(java.lang.String username)
|
FileAttributes |
getFileAttributes(byte[] handle)
|
FileAttributes |
getFileAttributes(java.lang.String path)
|
java.lang.String |
getRealPath(java.lang.String path)
|
VFSPermission |
getVFSPermission(java.lang.String path)
|
boolean |
makeDirectory(java.lang.String path)
|
byte[] |
openDirectory(java.lang.String path)
|
byte[] |
openFile(java.lang.String path,
UnsignedInteger32 flags,
FileAttributes attrs)
|
SftpFile[] |
readDirectory(byte[] handle)
|
byte[] |
readFile(byte[] handle,
UnsignedInteger64 offset,
UnsignedInteger32 len)
|
SftpFile |
readSymbolicLink(java.lang.String path)
|
void |
removeDirectory(java.lang.String path)
|
void |
removeFile(java.lang.String path)
|
void |
renameFile(java.lang.String oldpath,
java.lang.String newpath)
|
void |
setFileAttributes(byte[] handle,
FileAttributes attrs)
|
void |
setFileAttributes(java.lang.String path,
FileAttributes attrs)
|
static void |
setPermissionHandler(VFSPermissionHandler permissionHandler)
|
static boolean |
startsWithIgnoreCase(java.lang.String str,
java.lang.String with)
|
static java.lang.String |
translateCanonicalPath(java.lang.String path,
java.lang.String securemount)
|
static java.lang.String |
translateNFSPath(java.lang.String nfspath)
|
static java.lang.String |
translateVFSPath(java.lang.String vfspath)
|
static java.lang.String |
translateVFSPath(java.lang.String vfspath,
java.lang.String vfscwd)
|
void |
verifyPermissions(java.lang.String username,
java.lang.String path,
java.lang.String permissions)
|
void |
writeFile(byte[] handle,
UnsignedInteger64 offset,
byte[] data,
int off,
int len)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VirtualFileSystem
public VirtualFileSystem()
throws java.io.IOException
- Creates a new VirtualFileSystem object.
- Throws:
java.io.IOException
setPermissionHandler
public static void setPermissionHandler(VFSPermissionHandler permissionHandler)
startsWithIgnoreCase
public static boolean startsWithIgnoreCase(java.lang.String str,
java.lang.String with)
- Parameters:
str - with -
- Returns:
translateNFSPath
public static java.lang.String translateNFSPath(java.lang.String nfspath)
throws java.io.FileNotFoundException
- Parameters:
nfspath -
- Returns:
-
- Throws:
java.io.FileNotFoundException
translateVFSPath
public static java.lang.String translateVFSPath(java.lang.String vfspath)
throws java.io.FileNotFoundException
- Parameters:
vfspath -
- Returns:
-
- Throws:
java.io.FileNotFoundException
translateVFSPath
public static java.lang.String translateVFSPath(java.lang.String vfspath,
java.lang.String vfscwd)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
translateCanonicalPath
public static java.lang.String translateCanonicalPath(java.lang.String path,
java.lang.String securemount)
throws java.io.FileNotFoundException
- Parameters:
path - securemount -
- Returns:
-
- Throws:
java.io.FileNotFoundException
makeDirectory
public boolean makeDirectory(java.lang.String path)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
- Specified by:
makeDirectory in class NativeFileSystemProvider
- Parameters:
path -
- Returns:
-
- Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException
getVFSPermission
public VFSPermission getVFSPermission(java.lang.String path)
throws java.io.FileNotFoundException,
java.io.IOException
- Parameters:
path -
- Returns:
-
- Throws:
java.io.FileNotFoundException
java.io.IOException
getFileAttributes
public FileAttributes getFileAttributes(byte[] handle)
throws java.io.IOException,
InvalidHandleException
- Specified by:
getFileAttributes in class NativeFileSystemProvider
- Parameters:
handle -
- Returns:
-
- Throws:
java.io.IOException
InvalidHandleException
getFileAttributes
public FileAttributes getFileAttributes(java.lang.String path)
throws java.io.IOException,
java.io.FileNotFoundException
- Specified by:
getFileAttributes in class NativeFileSystemProvider
- Parameters:
path -
- Returns:
-
- Throws:
java.io.IOException
java.io.FileNotFoundException
openDirectory
public byte[] openDirectory(java.lang.String path)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
- Specified by:
openDirectory in class NativeFileSystemProvider
- Parameters:
path -
- Returns:
-
- Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException
readDirectory
public SftpFile[] readDirectory(byte[] handle)
throws InvalidHandleException,
java.io.EOFException,
java.io.IOException
- Specified by:
readDirectory in class NativeFileSystemProvider
- Parameters:
handle -
- Returns:
-
- Throws:
InvalidHandleException
java.io.EOFException
java.io.IOException
openFile
public byte[] openFile(java.lang.String path,
UnsignedInteger32 flags,
FileAttributes attrs)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
- Specified by:
openFile in class NativeFileSystemProvider
- Parameters:
path - flags - attrs -
- Returns:
-
- Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException
readFile
public byte[] readFile(byte[] handle,
UnsignedInteger64 offset,
UnsignedInteger32 len)
throws InvalidHandleException,
java.io.EOFException,
java.io.IOException
- Specified by:
readFile in class NativeFileSystemProvider
- Parameters:
handle - offset - len -
- Returns:
-
- Throws:
InvalidHandleException
java.io.EOFException
java.io.IOException
writeFile
public void writeFile(byte[] handle,
UnsignedInteger64 offset,
byte[] data,
int off,
int len)
throws InvalidHandleException,
java.io.IOException
- Specified by:
writeFile in class NativeFileSystemProvider
- Parameters:
handle - offset - data - off - len -
- Throws:
InvalidHandleException
java.io.IOException
closeFile
public void closeFile(byte[] handle)
throws InvalidHandleException,
java.io.IOException
- Specified by:
closeFile in class NativeFileSystemProvider
- Parameters:
handle -
- Throws:
InvalidHandleException
java.io.IOException
removeFile
public void removeFile(java.lang.String path)
throws PermissionDeniedException,
java.io.IOException,
java.io.FileNotFoundException
- Specified by:
removeFile in class NativeFileSystemProvider
- Parameters:
path -
- Throws:
PermissionDeniedException
java.io.IOException
java.io.FileNotFoundException
renameFile
public void renameFile(java.lang.String oldpath,
java.lang.String newpath)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
- Specified by:
renameFile in class NativeFileSystemProvider
- Parameters:
oldpath - newpath -
- Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException
removeDirectory
public void removeDirectory(java.lang.String path)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
- Specified by:
removeDirectory in class NativeFileSystemProvider
- Parameters:
path -
- Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException
setFileAttributes
public void setFileAttributes(java.lang.String path,
FileAttributes attrs)
throws PermissionDeniedException,
java.io.IOException,
java.io.FileNotFoundException
- Specified by:
setFileAttributes in class NativeFileSystemProvider
- Parameters:
path - attrs -
- Throws:
PermissionDeniedException
java.io.IOException
java.io.FileNotFoundException
setFileAttributes
public void setFileAttributes(byte[] handle,
FileAttributes attrs)
throws PermissionDeniedException,
java.io.IOException,
InvalidHandleException
- Specified by:
setFileAttributes in class NativeFileSystemProvider
- Parameters:
handle - attrs -
- Throws:
PermissionDeniedException
java.io.IOException
InvalidHandleException
readSymbolicLink
public SftpFile readSymbolicLink(java.lang.String path)
throws UnsupportedFileOperationException,
java.io.FileNotFoundException,
java.io.IOException,
PermissionDeniedException
- Specified by:
readSymbolicLink in class NativeFileSystemProvider
- Parameters:
path -
- Returns:
-
- Throws:
UnsupportedFileOperationException
java.io.FileNotFoundException
java.io.IOException
PermissionDeniedException
createSymbolicLink
public void createSymbolicLink(java.lang.String link,
java.lang.String target)
throws UnsupportedFileOperationException,
java.io.FileNotFoundException,
java.io.IOException,
PermissionDeniedException
- Specified by:
createSymbolicLink in class NativeFileSystemProvider
- Parameters:
link - target -
- Throws:
UnsupportedFileOperationException
java.io.FileNotFoundException
java.io.IOException
PermissionDeniedException
fileExists
public boolean fileExists(java.lang.String path)
throws java.io.IOException
- Specified by:
fileExists in class NativeFileSystemProvider
- Parameters:
path -
- Returns:
-
- Throws:
java.io.IOException
java.io.FileNotFoundException
getDefaultPath
public java.lang.String getDefaultPath(java.lang.String username)
throws java.io.FileNotFoundException
- Specified by:
getDefaultPath in class NativeFileSystemProvider
- Throws:
java.io.FileNotFoundException
getCanonicalPath
public java.lang.String getCanonicalPath(java.lang.String path)
throws java.io.IOException,
java.io.FileNotFoundException
- Specified by:
getCanonicalPath in class NativeFileSystemProvider
- Parameters:
path -
- Returns:
-
- Throws:
java.io.IOException
java.io.FileNotFoundException
getRealPath
public java.lang.String getRealPath(java.lang.String path)
throws java.io.FileNotFoundException
- Specified by:
getRealPath in class NativeFileSystemProvider
- Parameters:
path -
- Returns:
-
- Throws:
java.io.FileNotFoundException
verifyPermissions
public void verifyPermissions(java.lang.String username,
java.lang.String path,
java.lang.String permissions)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
- Specified by:
verifyPermissions in class NativeFileSystemProvider
- Parameters:
username - path - permissions -
- Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException
Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.