Secure iNet Factory

com.jscape.inet.sftp.v4
Class SftpClient4

java.lang.Object
  extended by com.jscape.inet.sftp.SftpClient
      extended by com.jscape.inet.sftp.v2.SftpClient2
          extended by com.jscape.inet.sftp.v3.SftpClient3
              extended by com.jscape.inet.sftp.v4.SftpClient4
All Implemented Interfaces:
JFileSystem

public class SftpClient4
extends SftpClient3

The SFTP client version 4.

Version:
1.0
Author:
Alex Usun

Field Summary
static int VERSION
          The client version
 
Constructor Summary
SftpClient4(com.jscape.inet.util.connection.Connection connection, SftpConfiguration config)
          Creates a new client instance.
 
Method Summary
 SftpFileAttributes fstat(byte[] handle)
          Obtains the remote file attributes.
 JFile getFile(JFile parent, java.lang.String child)
          Creates a new JFile instance from a parent abstract pathname and a child pathname string.
 JFile getFile(JFile parent, java.lang.String child, SftpFileAttributes attrs)
          Creates a new JFile instance from a parent abstract pathname and a child pathname string.
 JFile getFile(java.lang.String pathname)
          Creates a new JFile instance by converting the given pathname string into an abstract pathname.
 SftpFileAttributes lstat(java.lang.String path)
          Obtains the link target attributes.
 void mkdir(java.lang.String path, SftpFileAttributes attrs)
          Creates a new directory.
 byte[] open(java.lang.String path, JFileOpenFlags flags, JAcl.Mask accessType, SftpFileAttributes attrs)
          Opens or creates the file.
 void setFstat(byte[] handle, SftpFileAttributes attrs)
          Setups the remote file attributes.
 void setStat(java.lang.String path, SftpFileAttributes attrs)
          Setups the remote file attributes.
 SftpFileAttributes stat(java.lang.String path)
          Obtains the remote file attributes.
 
Methods inherited from class com.jscape.inet.sftp.v3.SftpClient3
readLink, symlink
 
Methods inherited from class com.jscape.inet.sftp.v2.SftpClient2
rename
 
Methods inherited from class com.jscape.inet.sftp.SftpClient
close, close, containsExtension, create, getCharset, getConnection, getExtension, getStringExtension, getVersion, isClosed, knowsPacket, opendir, read, readdir, realPath, registerPacket, remove, rmdir, sendRequest, setCharset, unregisterPacket, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final int VERSION
The client version

See Also:
Constant Field Values
Constructor Detail

SftpClient4

public SftpClient4(com.jscape.inet.util.connection.Connection connection,
                   SftpConfiguration config)
            throws java.io.IOException
Creates a new client instance.

Parameters:
connection - the session channel
config - the configuration
Throws:
SftpException - if an I/O or SFTP error occurs.
java.io.IOException
Method Detail

getFile

public JFile getFile(java.lang.String pathname)
Creates a new JFile instance by converting the given pathname string into an abstract pathname.

Specified by:
getFile in interface JFileSystem
Overrides:
getFile in class SftpClient3
Parameters:
pathname - a pathname string
Returns:
a new JFile instance

getFile

public JFile getFile(JFile parent,
                     java.lang.String child)
Creates a new JFile instance from a parent abstract pathname and a child pathname string.

Specified by:
getFile in interface JFileSystem
Overrides:
getFile in class SftpClient3
Parameters:
parent - the parent abstract pathname
child - the child pathname string
Returns:
a new JFile instance

getFile

public JFile getFile(JFile parent,
                     java.lang.String child,
                     SftpFileAttributes attrs)
Creates a new JFile instance from a parent abstract pathname and a child pathname string.

Overrides:
getFile in class SftpClient3
Parameters:
parent - the parent abstract pathname
child - the child pathname string
attrs - the file attributes
Returns:
a new JFile instance

mkdir

public void mkdir(java.lang.String path,
                  SftpFileAttributes attrs)
           throws SftpException
Creates a new directory.

Overrides:
mkdir in class SftpClient
Parameters:
path - the directory path
attrs - the directory attributes
Throws:
SftpException - if an I/O or SFTP error occurs.

stat

public SftpFileAttributes stat(java.lang.String path)
                        throws SftpException
Obtains the remote file attributes.

Overrides:
stat in class SftpClient
Parameters:
path - the file path
Returns:
the file attributes
Throws:
SftpException - if an I/O or SFTP error occurs.

lstat

public SftpFileAttributes lstat(java.lang.String path)
                         throws SftpException
Obtains the link target attributes.

Overrides:
lstat in class SftpClient
Parameters:
path - the link path
Returns:
the file attributes
Throws:
SftpException - if an I/O or SFTP error occurs.

fstat

public SftpFileAttributes fstat(byte[] handle)
                         throws SftpException
Obtains the remote file attributes.

Overrides:
fstat in class SftpClient
Parameters:
handle - the file handle
Returns:
the file attributes
Throws:
SftpException - if an I/O or SFTP error occurs.

setStat

public void setStat(java.lang.String path,
                    SftpFileAttributes attrs)
             throws SftpException
Setups the remote file attributes.

Overrides:
setStat in class SftpClient
Parameters:
path - the file path
attrs - desired file attributes
Throws:
SftpException - if an I/O or SFTP error occurs.

setFstat

public void setFstat(byte[] handle,
                     SftpFileAttributes attrs)
              throws SftpException
Setups the remote file attributes.

Overrides:
setFstat in class SftpClient
Parameters:
handle - the file handle
attrs - desired file attributes
Throws:
SftpException - if an I/O or SFTP error occurs.

open

public byte[] open(java.lang.String path,
                   JFileOpenFlags flags,
                   JAcl.Mask accessType,
                   SftpFileAttributes attrs)
            throws SftpException
Opens or creates the file.

Overrides:
open in class SftpClient
Parameters:
path - the file path
flags - the open flags
accessType - file access type
attrs - the file attributes
Returns:
a file handle
Throws:
SftpException - if an I/O or SFTP error occurs.

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved