Secure iNet Factory

com.jscape.inet.sftp.packets
Class SshFxpOpen

java.lang.Object
  extended by com.jscape.inet.sftp.SftpPacket
      extended by com.jscape.inet.sftp.packets.SshFxpOpen
All Implemented Interfaces:
Dispatchable

public class SshFxpOpen
extends SftpPacket
implements Dispatchable

The SSH_FXP_OPEN packet.

Version:
1.0
Author:
Alex Usun

Field Summary
static int TYPE
          The SFTP packet type
 
Constructor Summary
SshFxpOpen(java.lang.String path, JFileOpenFlags flags, JAcl.Mask accessType, SftpFileAttributes attrs)
          Creates a new packet instance.
 
Method Summary
 SftpPacket accept(PacketDispatcher dispatcher)
          The "backwards dispatching" support.
 JAcl.Mask getAccessType()
          Obtains the file access type.
 SftpFileAttributes getAttrs()
          Obtains the file attributes.
 java.lang.String getFileName()
          Obtains the file name.
 JFileOpenFlags getFlags()
          Obtains the file open flags.
static SftpPacket readFrom(java.io.InputStream in, java.lang.String charset)
          Reads the packet from the stream.
 java.lang.String toString()
          Provides the human-readable packet representation.
 void writeTo(java.io.OutputStream out, java.lang.String charset)
          Writes the current packet to the specified stream.
 
Methods inherited from class com.jscape.inet.sftp.SftpPacket
getId, getType, readFrom, readFrom, setId, writeTo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final int TYPE
The SFTP packet type

See Also:
Constant Field Values
Constructor Detail

SshFxpOpen

public SshFxpOpen(java.lang.String path,
                  JFileOpenFlags flags,
                  JAcl.Mask accessType,
                  SftpFileAttributes attrs)
Creates a new packet instance.

Parameters:
path - the file path
flags - the open flags
accessType - the file access type
attrs - the file attributes
Method Detail

readFrom

public static SftpPacket readFrom(java.io.InputStream in,
                                  java.lang.String charset)
                           throws java.io.IOException
Reads the packet from the stream.

Parameters:
in - the source input stream
Returns:
the readed packet
Throws:
java.io.IOException - if an I/O error occurs

getFileName

public java.lang.String getFileName()
Obtains the file name.

Returns:
the file name

getFlags

public JFileOpenFlags getFlags()
Obtains the file open flags.

Returns:
the file open flags

getAccessType

public JAcl.Mask getAccessType()
Obtains the file access type.

Returns:
the file access type

getAttrs

public SftpFileAttributes getAttrs()
Obtains the file attributes.

Returns:
the file attributes

writeTo

public void writeTo(java.io.OutputStream out,
                    java.lang.String charset)
             throws java.io.IOException
Writes the current packet to the specified stream.

Overrides:
writeTo in class SftpPacket
Parameters:
out - the output stream
Throws:
java.io.IOException - if I/O error occured

accept

public SftpPacket accept(PacketDispatcher dispatcher)
                  throws java.io.IOException
The "backwards dispatching" support.

Specified by:
accept in interface Dispatchable
Parameters:
dispatcher - the packet dispatcher
Returns:
the response
Throws:
java.io.IOException - if an I/O error occurs

toString

public java.lang.String toString()
Provides the human-readable packet representation.

Overrides:
toString in class java.lang.Object
Returns:
the human-readable packet representation.

Secure iNet Factory

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