com.sshtools.daemon.platform
Class NativeFileSystemProvider

java.lang.Object
  extended by com.sshtools.daemon.platform.NativeFileSystemProvider
Direct Known Subclasses:
VirtualFileSystem

public abstract class NativeFileSystemProvider
extends java.lang.Object

Version:
$Revision: 1.1 $
Author:
$author$

Field Summary
private static NativeFileSystemProvider instance
           
private static org.apache.commons.logging.Log log
           
static int OPEN_APPEND
           
static int OPEN_CREATE
           
static int OPEN_EXCLUSIVE
           
static int OPEN_READ
           
static int OPEN_TRUNCATE
           
static int OPEN_WRITE
           
 
Constructor Summary
NativeFileSystemProvider()
           
 
Method Summary
abstract  void closeFile(byte[] handle)
           
abstract  void createSymbolicLink(java.lang.String link, java.lang.String target)
           
abstract  boolean fileExists(java.lang.String path)
           
abstract  java.lang.String getCanonicalPath(java.lang.String path)
           
abstract  java.lang.String getDefaultPath(java.lang.String username)
           
abstract  FileAttributes getFileAttributes(byte[] handle)
           
abstract  FileAttributes getFileAttributes(java.lang.String path)
           
static NativeFileSystemProvider getInstance()
           
abstract  java.lang.String getRealPath(java.lang.String path)
           
abstract  boolean makeDirectory(java.lang.String path)
           
abstract  byte[] openDirectory(java.lang.String path)
           
abstract  byte[] openFile(java.lang.String path, UnsignedInteger32 flags, FileAttributes attrs)
           
abstract  SftpFile[] readDirectory(byte[] handle)
           
abstract  byte[] readFile(byte[] handle, UnsignedInteger64 offset, UnsignedInteger32 len)
           
abstract  SftpFile readSymbolicLink(java.lang.String path)
           
abstract  void removeDirectory(java.lang.String path)
           
abstract  void removeFile(java.lang.String path)
           
abstract  void renameFile(java.lang.String oldpath, java.lang.String newpath)
           
abstract  void setFileAttributes(byte[] handle, FileAttributes attrs)
           
abstract  void setFileAttributes(java.lang.String path, FileAttributes attrs)
           
abstract  void verifyPermissions(java.lang.String username, java.lang.String path, java.lang.String permissions)
           
abstract  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
 

Field Detail

log

private static org.apache.commons.logging.Log log

instance

private static NativeFileSystemProvider instance

OPEN_READ

public static final int OPEN_READ
See Also:
Constant Field Values

OPEN_WRITE

public static final int OPEN_WRITE
See Also:
Constant Field Values

OPEN_APPEND

public static final int OPEN_APPEND
See Also:
Constant Field Values

OPEN_CREATE

public static final int OPEN_CREATE
See Also:
Constant Field Values

OPEN_TRUNCATE

public static final int OPEN_TRUNCATE
See Also:
Constant Field Values

OPEN_EXCLUSIVE

public static final int OPEN_EXCLUSIVE
See Also:
Constant Field Values
Constructor Detail

NativeFileSystemProvider

public NativeFileSystemProvider()
Method Detail

fileExists

public abstract boolean fileExists(java.lang.String path)
                            throws java.io.IOException
Parameters:
path -
Returns:
Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException

getCanonicalPath

public abstract java.lang.String getCanonicalPath(java.lang.String path)
                                           throws java.io.IOException,
                                                  java.io.FileNotFoundException
Parameters:
path -
Returns:
Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException

getRealPath

public abstract java.lang.String getRealPath(java.lang.String path)
                                      throws java.io.FileNotFoundException
Parameters:
path -
Returns:
Throws:
java.io.FileNotFoundException

makeDirectory

public abstract boolean makeDirectory(java.lang.String path)
                               throws PermissionDeniedException,
                                      java.io.FileNotFoundException,
                                      java.io.IOException
Parameters:
path -
Returns:
Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException

getFileAttributes

public abstract FileAttributes getFileAttributes(java.lang.String path)
                                          throws java.io.IOException,
                                                 java.io.FileNotFoundException
Parameters:
path -
Returns:
Throws:
java.io.IOException
java.io.FileNotFoundException

getFileAttributes

public abstract FileAttributes getFileAttributes(byte[] handle)
                                          throws java.io.IOException,
                                                 InvalidHandleException
Parameters:
handle -
Returns:
Throws:
java.io.IOException
InvalidHandleException

openDirectory

public abstract byte[] openDirectory(java.lang.String path)
                              throws PermissionDeniedException,
                                     java.io.FileNotFoundException,
                                     java.io.IOException
Parameters:
path -
Returns:
Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException

readDirectory

public abstract SftpFile[] readDirectory(byte[] handle)
                                  throws InvalidHandleException,
                                         java.io.EOFException,
                                         java.io.IOException
Parameters:
handle -
Returns:
Throws:
InvalidHandleException
java.io.EOFException
java.io.IOException

openFile

public abstract byte[] openFile(java.lang.String path,
                                UnsignedInteger32 flags,
                                FileAttributes attrs)
                         throws PermissionDeniedException,
                                java.io.FileNotFoundException,
                                java.io.IOException
Parameters:
path -
flags -
attrs -
Returns:
Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException

readFile

public abstract byte[] readFile(byte[] handle,
                                UnsignedInteger64 offset,
                                UnsignedInteger32 len)
                         throws InvalidHandleException,
                                java.io.EOFException,
                                java.io.IOException
Parameters:
handle -
offset -
len -
Returns:
Throws:
InvalidHandleException
java.io.EOFException
java.io.IOException

writeFile

public abstract void writeFile(byte[] handle,
                               UnsignedInteger64 offset,
                               byte[] data,
                               int off,
                               int len)
                        throws InvalidHandleException,
                               java.io.IOException
Parameters:
handle -
offset -
data -
off -
len -
Throws:
InvalidHandleException
java.io.IOException

closeFile

public abstract void closeFile(byte[] handle)
                        throws InvalidHandleException,
                               java.io.IOException
Parameters:
handle -
Throws:
InvalidHandleException
java.io.IOException

removeFile

public abstract void removeFile(java.lang.String path)
                         throws PermissionDeniedException,
                                java.io.IOException,
                                java.io.FileNotFoundException
Parameters:
path -
Throws:
PermissionDeniedException
java.io.IOException
java.io.FileNotFoundException

renameFile

public abstract void renameFile(java.lang.String oldpath,
                                java.lang.String newpath)
                         throws PermissionDeniedException,
                                java.io.FileNotFoundException,
                                java.io.IOException
Parameters:
oldpath -
newpath -
Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException

removeDirectory

public abstract void removeDirectory(java.lang.String path)
                              throws PermissionDeniedException,
                                     java.io.FileNotFoundException,
                                     java.io.IOException
Parameters:
path -
Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException

setFileAttributes

public abstract void setFileAttributes(java.lang.String path,
                                       FileAttributes attrs)
                                throws PermissionDeniedException,
                                       java.io.IOException,
                                       java.io.FileNotFoundException
Parameters:
path -
attrs -
Throws:
PermissionDeniedException
java.io.IOException
java.io.FileNotFoundException

setFileAttributes

public abstract void setFileAttributes(byte[] handle,
                                       FileAttributes attrs)
                                throws PermissionDeniedException,
                                       java.io.IOException,
                                       InvalidHandleException
Parameters:
handle -
attrs -
Throws:
PermissionDeniedException
java.io.IOException
InvalidHandleException

readSymbolicLink

public abstract SftpFile readSymbolicLink(java.lang.String path)
                                   throws UnsupportedFileOperationException,
                                          java.io.FileNotFoundException,
                                          java.io.IOException,
                                          PermissionDeniedException
Parameters:
path -
Returns:
Throws:
UnsupportedFileOperationException
java.io.FileNotFoundException
java.io.IOException
PermissionDeniedException

createSymbolicLink

public abstract void createSymbolicLink(java.lang.String link,
                                        java.lang.String target)
                                 throws UnsupportedFileOperationException,
                                        java.io.FileNotFoundException,
                                        java.io.IOException,
                                        PermissionDeniedException
Parameters:
link -
target -
Throws:
UnsupportedFileOperationException
java.io.FileNotFoundException
java.io.IOException
PermissionDeniedException

getDefaultPath

public abstract java.lang.String getDefaultPath(java.lang.String username)
                                         throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

verifyPermissions

public abstract void verifyPermissions(java.lang.String username,
                                       java.lang.String path,
                                       java.lang.String permissions)
                                throws PermissionDeniedException,
                                       java.io.FileNotFoundException,
                                       java.io.IOException
Parameters:
username -
path -
permissions -
Throws:
PermissionDeniedException
java.io.FileNotFoundException
java.io.IOException

getInstance

public static NativeFileSystemProvider getInstance()
Returns: