Package com.sshtools.j2ssh.sftp
Class SftpFile
- java.lang.Object
-
- 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.23 $
- Author:
- $author$
-
-
Constructor Summary
Constructors Constructor Description SftpFile(java.lang.String absolutePath)Creates a new SftpFile object.SftpFile(java.lang.String absolutePath, FileAttributes attrs)Creates a new SftpFile object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanRead()booleancanWrite()voidclose()intcompareTo(java.lang.Object o)voiddelete()java.lang.StringgetAbsolutePath()FileAttributesgetAttributes()java.lang.StringgetFilename()protected byte[]getHandle()java.lang.StringgetLongname()protected SftpSubsystemClientgetSFTPSubsystem()booleanisBlock()booleanisCharacter()booleanisDirectory()booleanisFifo()booleanisFile()booleanisLink()booleanisOpen()booleanisSocket()voidrename(java.lang.String newFilename)protected voidsetHandle(byte[] handle)protected voidsetSFTPSubsystem(SftpSubsystemClient sftp)
-
-
-
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:
-
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:
compareToin interfacejava.lang.Comparable
-
-