com.sshtools.j2ssh.sftp
Class SftpFile

java.lang.Object
  extended by com.sshtools.j2ssh.sftp.SftpFile
All Implemented Interfaces:
java.lang.Comparable

public class SftpFile
extends java.lang.Object
implements java.lang.Comparable

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

Field Summary
private  java.lang.String absolutePath
           
private  FileAttributes attrs
           
private  java.lang.String filename
           
private  byte[] handle
           
private  SftpSubsystemClient sftp
           
 
Constructor Summary
SftpFile(java.lang.String absolutePath)
          Creates a new SftpFile object.
SftpFile(java.lang.String absolutePath, FileAttributes attrs)
          Creates a new SftpFile object.
 
Method Summary
 boolean canRead()
           
 boolean canWrite()
           
 void close()
           
 int compareTo(java.lang.Object o)
           
 void delete()
           
 java.lang.String getAbsolutePath()
           
 FileAttributes getAttributes()
           
 java.lang.String getFilename()
           
protected  byte[] getHandle()
           
 java.lang.String getLongname()
           
protected  SftpSubsystemClient getSFTPSubsystem()
           
 boolean isBlock()
           
 boolean isCharacter()
           
 boolean isDirectory()
           
 boolean isFifo()
           
 boolean isFile()
           
 boolean isLink()
           
 boolean isOpen()
           
 boolean isSocket()
           
private  java.lang.String pad(int num)
           
 void rename(java.lang.String newFilename)
           
protected  void setHandle(byte[] handle)
           
protected  void setSFTPSubsystem(SftpSubsystemClient sftp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filename

private java.lang.String filename

handle

private byte[] handle

attrs

private FileAttributes attrs

sftp

private SftpSubsystemClient sftp

absolutePath

private java.lang.String absolutePath
Constructor Detail

SftpFile

public SftpFile(java.lang.String absolutePath,
                FileAttributes attrs)
Creates a new SftpFile object.

Parameters:
absolutePath -
attrs -

SftpFile

public SftpFile(java.lang.String absolutePath)
Creates a new SftpFile object.

Parameters:
absolutePath -
Method Detail

delete

public void delete()
            throws java.io.IOException
Throws:
java.io.IOException

rename

public void rename(java.lang.String newFilename)
            throws java.io.IOException
Parameters:
newFilename -
Throws:
java.io.IOException

canWrite

public boolean canWrite()
Returns:

canRead

public boolean canRead()
Returns:

isOpen

public boolean isOpen()
Returns:

setHandle

protected void setHandle(byte[] handle)
Parameters:
handle -

getHandle

protected byte[] getHandle()
Returns:

setSFTPSubsystem

protected void setSFTPSubsystem(SftpSubsystemClient sftp)
Parameters:
sftp -

getSFTPSubsystem

protected SftpSubsystemClient getSFTPSubsystem()
Returns:

getFilename

public java.lang.String getFilename()
Returns:

pad

private java.lang.String pad(int num)

getLongname

public java.lang.String getLongname()
Returns:

getAttributes

public FileAttributes getAttributes()
Returns:

getAbsolutePath

public java.lang.String getAbsolutePath()
Returns:

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

isDirectory

public boolean isDirectory()
Returns:

isFile

public boolean isFile()
Returns:

isLink

public boolean isLink()
Returns:

isFifo

public boolean isFifo()
Returns:

isBlock

public boolean isBlock()
Returns:

isCharacter

public boolean isCharacter()
Returns:

isSocket

public boolean isSocket()
Returns:

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable