# SFTPEngine (sshj 0.5.0 API)
Date: 2011-07-27

## net.schmizz.sshj.sftp
Class SFTPEngine

    java.lang.Object
      net.schmizz.sshj.sftp.SFTPEngine

All Implemented Interfaces:
  Closeable, Requester

    public class SFTPEngine

extends Object
implements Requester, Closeable

Field Summary
`static int` `DEFAULT_TIMEOUT`
`protected org.slf4j.Logger` `log` Logger
`static int` `MAX_SUPPORTED_VERSION`
`protected int` `operativeVersion`
`protected OutputStream` `out`
`protected PathHelper` `pathHelper`
`protected PacketReader` `reader`
`protected long` `reqID`
`protected Map<String,String>` `serverExtensions`
`protected Session.Subsystem` `sub`
`protected int` `timeout`

Constructor Summary
`SFTPEngine(SessionFactory ssh)`
`SFTPEngine(SessionFactory ssh, String pathSep)`

Method Summary
`String` `canonicalize(String path)`
`void` `close()`
`Response` `doRequest(Request req)`
`int` `getOperativeProtocolVersion()`
`PathHelper` `getPathHelper()`
`Session.Subsystem` `getSubsystem()`
`int` `getTimeout()`
`SFTPEngine` `init()`
`FileAttributes` `lstat(String path)`
`void` `makeDir(String path)`
`void` `makeDir(String path, FileAttributes attrs)`
`Request` `newExtendedRequest(String reqName)`
`Request` `newRequest(PacketType type)`
`RemoteFile` `open(String filename)`
`RemoteFile` `open(String filename, Set<OpenMode> modes)`
`RemoteFile` `open(String path, Set<OpenMode> modes, FileAttributes fa)`
`RemoteDirectory` `openDir(String path)`
`String` `readLink(String path)`
`protected static String` `readSingleName(Response res)`
`void` `remove(String filename)`
`void` `removeDir(String path)`
`void` `rename(String oldPath, String newPath)`
`void` `setAttributes(String path, FileAttributes attrs)`
`void` `setTimeout(int timeout)`
`protected FileAttributes` `stat(PacketType pt, String path)`
`FileAttributes` `stat(String path)`
`void` `symlink(String linkpath, String targetpath)`
`protected void` `transmit(SFTPPacket<Request> payload)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MAX_SUPPORTED_VERSION

    public static final int MAX_SUPPORTED_VERSION

See Also:
  Constant Field Values

### DEFAULT_TIMEOUT

    public static final int DEFAULT_TIMEOUT

See Also:
  Constant Field Values

### log

    protected final org.slf4j.Logger log

  Logger

### timeout

    protected volatile int timeout

### pathHelper

    protected final PathHelper pathHelper

### sub

    protected final Session.Subsystem sub

### reader

    protected final PacketReader reader

### out

    protected final OutputStream out

### reqID

    protected long reqID

### operativeVersion

    protected int operativeVersion

### serverExtensions

    protected final Map<String,String> serverExtensions

Constructor Detail

### SFTPEngine

    public SFTPEngine(SessionFactory ssh)
               throws SSHException

Throws:
  `SSHException`

### SFTPEngine

    public SFTPEngine(SessionFactory ssh,
                      String pathSep)
               throws SSHException

Throws:
  `SSHException`

Method Detail

### init

    public SFTPEngine init()
                    throws IOException

  Throws:
    `IOException`

### getSubsystem

    public Session.Subsystem getSubsystem()

### getOperativeProtocolVersion

    public int getOperativeProtocolVersion()

### newExtendedRequest

    public Request newExtendedRequest(String reqName)

### getPathHelper

    public PathHelper getPathHelper()

  Specified by:
    `getPathHelper` in interface `Requester`

### newRequest

    public Request newRequest(PacketType type)

  Specified by:
    `newRequest` in interface `Requester`

### doRequest

    public Response doRequest(Request req)
                       throws IOException

  Specified by:
    `doRequest` in interface `Requester`
  Throws:
    `IOException`

### open

    public RemoteFile open(String path,
                           Set<OpenMode> modes,
                           FileAttributes fa)
                    throws IOException

  Throws:
    `IOException`

### open

    public RemoteFile open(String filename,
                           Set<OpenMode> modes)
                    throws IOException

  Throws:
    `IOException`

### open

    public RemoteFile open(String filename)
                    throws IOException

  Throws:
    `IOException`

### openDir

    public RemoteDirectory openDir(String path)
                            throws IOException

  Throws:
    `IOException`

### setAttributes

    public void setAttributes(String path,
                              FileAttributes attrs)
                       throws IOException

  Throws:
    `IOException`

### readLink

    public String readLink(String path)
                    throws IOException

  Throws:
    `IOException`

### makeDir

    public void makeDir(String path,
                        FileAttributes attrs)
                 throws IOException

  Throws:
    `IOException`

### makeDir

    public void makeDir(String path)
                 throws IOException

  Throws:
    `IOException`

### symlink

    public void symlink(String linkpath,
                        String targetpath)
                 throws IOException

  Throws:
    `IOException`

### remove

    public void remove(String filename)
                throws IOException

  Throws:
    `IOException`

### removeDir

    public void removeDir(String path)
                   throws IOException

  Throws:
    `IOException`

### stat

    public FileAttributes stat(String path)
                        throws IOException

  Throws:
    `IOException`

### lstat

    public FileAttributes lstat(String path)
                         throws IOException

  Throws:
    `IOException`

### rename

    public void rename(String oldPath,
                       String newPath)
                throws IOException

  Throws:
    `IOException`

### canonicalize

    public String canonicalize(String path)
                        throws IOException

  Throws:
    `IOException`

### setTimeout

    public void setTimeout(int timeout)

### getTimeout

    public int getTimeout()

### close

    public void close()
               throws IOException

  Specified by:
    `close` in interface `Closeable`
  Throws:
    `IOException`

### stat

    protected FileAttributes stat(PacketType pt,
                                  String path)
                           throws IOException

  Throws:
    `IOException`

### readSingleName

    protected static String readSingleName(Response res)
                                    throws IOException

  Throws:
    `IOException`

### transmit

    protected void transmit(SFTPPacket<Request> payload)
                     throws IOException

  Throws:
    `IOException`

Copyright © 2009-2011. All Rights Reserved.