com.sshtools.daemon.vfs

Class VirtualFileSystem


public class VirtualFileSystem
extends NativeFileSystemProvider

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

VirtualFileSystem()
Creates a new VirtualFileSystem object.

Method Summary

void
closeFile(byte[] handle)
void
createSymbolicLink(String link, String target)
boolean
fileExists(String path)
String
getCanonicalPath(String path)
String
getDefaultPath(String username)
FileAttributes
getFileAttributes(String path)
FileAttributes
getFileAttributes(byte[] handle)
String
getRealPath(String path)
VFSPermission
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)
SftpFile
readSymbolicLink(String path)
void
removeDirectory(String path)
void
removeFile(String path)
void
renameFile(String oldpath, String newpath)
void
setFileAttributes(String path, FileAttributes attrs)
void
setFileAttributes(byte[] handle, 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

closeFile, createSymbolicLink, fileExists, getCanonicalPath, getDefaultPath, getFileAttributes, getFileAttributes, getInstance, getRealPath, makeDirectory, openDirectory, openFile, readDirectory, readFile, readSymbolicLink, removeDirectory, removeFile, renameFile, setFileAttributes, setFileAttributes, verifyPermissions, writeFile

Constructor Details

VirtualFileSystem

public VirtualFileSystem()
            throws IOException
Creates a new VirtualFileSystem object.

Method Details

closeFile

public void closeFile(byte[] handle)
            throws InvalidHandleException,
                   IOException
Overrides:
closeFile in interface NativeFileSystemProvider
Parameters:
handle -

createSymbolicLink

public void createSymbolicLink(String link,
                               String target)
            throws UnsupportedFileOperationException,
                   FileNotFoundException,
                   IOException,
                   PermissionDeniedException
Overrides:
createSymbolicLink in interface NativeFileSystemProvider
Parameters:
link -
target -

fileExists

public boolean fileExists(String path)
            throws IOException
Overrides:
fileExists in interface NativeFileSystemProvider
Parameters:
path -
Returns:

getCanonicalPath

public String getCanonicalPath(String path)
            throws IOException,
                   FileNotFoundException
Overrides:
getCanonicalPath in interface NativeFileSystemProvider
Parameters:
path -
Returns:

getDefaultPath

public String getDefaultPath(String username)
            throws FileNotFoundException
Overrides:
getDefaultPath in interface NativeFileSystemProvider

getFileAttributes

public FileAttributes getFileAttributes(String path)
            throws IOException,
                   FileNotFoundException
Overrides:
getFileAttributes in interface NativeFileSystemProvider
Parameters:
path -
Returns:

getFileAttributes

public FileAttributes getFileAttributes(byte[] handle)
            throws IOException,
                   InvalidHandleException
Overrides:
getFileAttributes in interface NativeFileSystemProvider
Parameters:
handle -
Returns:

getRealPath

public String getRealPath(String path)
            throws FileNotFoundException
Overrides:
getRealPath in interface NativeFileSystemProvider
Parameters:
path -
Returns:

getVFSPermission

public VFSPermission getVFSPermission(String path)
            throws FileNotFoundException,
                   IOException
Parameters:
path -
Returns:

makeDirectory

public boolean makeDirectory(String path)
            throws PermissionDeniedException,
                   FileNotFoundException,
                   IOException
Overrides:
makeDirectory in interface NativeFileSystemProvider
Parameters:
path -
Returns:

openDirectory

public byte[] openDirectory(String path)
            throws PermissionDeniedException,
                   FileNotFoundException,
                   IOException
Overrides:
openDirectory in interface NativeFileSystemProvider
Parameters:
path -
Returns:

openFile

public byte[] openFile(String path,
                       UnsignedInteger32 flags,
                       FileAttributes attrs)
            throws PermissionDeniedException,
                   FileNotFoundException,
                   IOException
Overrides:
openFile in interface NativeFileSystemProvider
Parameters:
path -
flags -
attrs -
Returns:

readDirectory

public SftpFile[] readDirectory(byte[] handle)
            throws InvalidHandleException,
                   EOFException,
                   IOException
Overrides:
readDirectory in interface NativeFileSystemProvider
Parameters:
handle -
Returns:

readFile

public byte[] readFile(byte[] handle,
                       UnsignedInteger64 offset,
                       UnsignedInteger32 len)
            throws InvalidHandleException,
                   EOFException,
                   IOException
Overrides:
readFile in interface NativeFileSystemProvider
Parameters:
handle -
offset -
len -
Returns:

readSymbolicLink

public SftpFile readSymbolicLink(String path)
            throws UnsupportedFileOperationException,
                   FileNotFoundException,
                   IOException,
                   PermissionDeniedException
Overrides:
readSymbolicLink in interface NativeFileSystemProvider
Parameters:
path -
Returns:

removeDirectory

public void removeDirectory(String path)
            throws PermissionDeniedException,
                   FileNotFoundException,
                   IOException
Overrides:
removeDirectory in interface NativeFileSystemProvider
Parameters:
path -

removeFile

public void removeFile(String path)
            throws PermissionDeniedException,
                   IOException,
                   FileNotFoundException
Overrides:
removeFile in interface NativeFileSystemProvider
Parameters:
path -

renameFile

public void renameFile(String oldpath,
                       String newpath)
            throws PermissionDeniedException,
                   FileNotFoundException,
                   IOException
Overrides:
renameFile in interface NativeFileSystemProvider
Parameters:
oldpath -
newpath -

setFileAttributes

public void setFileAttributes(String path,
                              FileAttributes attrs)
            throws PermissionDeniedException,
                   IOException,
                   FileNotFoundException
Overrides:
setFileAttributes in interface NativeFileSystemProvider
Parameters:
path -
attrs -

setFileAttributes

public void setFileAttributes(byte[] handle,
                              FileAttributes attrs)
            throws PermissionDeniedException,
                   IOException,
                   InvalidHandleException
Overrides:
setFileAttributes in interface NativeFileSystemProvider
Parameters:
handle -
attrs -

setPermissionHandler

public static void setPermissionHandler(VFSPermissionHandler permissionHandler)

startsWithIgnoreCase

public static boolean startsWithIgnoreCase(String str,
                                           String with)
Parameters:
str -
with -
Returns:

translateCanonicalPath

public static String translateCanonicalPath(String path,
                                            String securemount)
            throws FileNotFoundException
Parameters:
path -
securemount -
Returns:

translateNFSPath

public static String translateNFSPath(String nfspath)
            throws FileNotFoundException
Parameters:
nfspath -
Returns:

translateVFSPath

public static String translateVFSPath(String vfspath)
            throws FileNotFoundException
Parameters:
vfspath -
Returns:

translateVFSPath

public static String translateVFSPath(String vfspath,
                                      String vfscwd)
            throws FileNotFoundException

verifyPermissions

public void verifyPermissions(String username,
                              String path,
                              String permissions)
            throws PermissionDeniedException,
                   FileNotFoundException,
                   IOException
Overrides:
verifyPermissions in interface NativeFileSystemProvider
Parameters:
username -
path -
permissions -

writeFile

public void writeFile(byte[] handle,
                      UnsignedInteger64 offset,
                      byte[] data,
                      int off,
                      int len)
            throws InvalidHandleException,
                   IOException
Overrides:
writeFile in interface NativeFileSystemProvider
Parameters:
handle -
offset -
data -
off -
len -

Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.