Secure iNet Factory

com.jscape.inet.sftp.packets
Class SftpName

java.lang.Object
  extended by com.jscape.inet.sftp.packets.SftpName

public class SftpName
extends java.lang.Object

The SFTP NAME abstraction. This class is used to combine remote file attributes while directory listing.

Version:
1.0
Author:
Alex Usun

Constructor Summary
SftpName(byte[] fileName, byte[] longName, SftpFileAttributes attrs)
          Creates a new file name instance.
 
Method Summary
 SftpFileAttributes getAttrs()
          Obtains the file attributes.
 byte[] getFileName()
          Obtains the file name.
 java.lang.String getFileName(java.lang.String charset)
          Obtains the file name.
 byte[] getLongName()
          Obtains the long file name.
static SftpName readFrom(java.io.InputStream in, java.lang.String charset)
          Reads the file name from the stream.
 java.lang.String toString()
           
 void writeTo(java.io.OutputStream out, java.lang.String charset)
          Writes the current file name to the stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SftpName

public SftpName(byte[] fileName,
                byte[] longName,
                SftpFileAttributes attrs)
Creates a new file name instance.

Parameters:
fileName - the file name
longName - the long file name
attrs - the file attributes
Method Detail

readFrom

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

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

getFileName

public byte[] getFileName()
Obtains the file name.

Returns:
the file name

getFileName

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

Parameters:
charset - charset name
Returns:
the file name

getLongName

public byte[] getLongName()
Obtains the long file name.

Returns:
the long file name

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 file name to the stream.

Parameters:
out - the destination stream
Throws:
java.io.IOException - if an I/O error occurs

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Secure iNet Factory

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