Your browser does not support HTML5 local storage or you have disabled it. Some functionality on this site, including saving your privacy settings and offering you special discounts, uses local storage and may not work with local storage disabled. We recommend allowing the use of local storage in your browser. In some browsers, it is the same setting used for disabling cookies.


com.ssh.sft
Class File

java.lang.Object
  extended bycom.ssh.sft.SftLib
      extended bycom.ssh.sft.SftBase
          extended bycom.ssh.sft.File
All Implemented Interfaces:
SftLibConstants, com.ssh.sft.SshSftFileType
Direct Known Subclasses:
Directory, RegularFile, SymLink

public abstract class File
extends com.ssh.sft.SftBase
implements com.ssh.sft.SshSftFileType

A remote file. An instance of this class represents a particular file at a particular location at a particular time. An instance will no longer be valid once the file or its parent directories are moved or deleted. This class is abstract, and contains only the operations applicable to all files.


Field Summary
static intSSH_SFT_FILE_TYPE_DIRECTORY
           
static intSSH_SFT_FILE_TYPE_REGULAR
           
static intSSH_SFT_FILE_TYPE_SPECIAL
           
static intSSH_SFT_FILE_TYPE_SYMLINK
           
static intSSH_SFT_FILE_TYPE_UNKNOWN
           
 
Fields inherited from interface com.ssh.sft.SftLibConstants
SSH_SFT_API_VERSION, SSH_SFT_DIR_RECURSIVE, SSH_SFT_HASH_MAX_BLOCK_SIZE, SSH_SFT_HASH_MAX_ITERATIONS, SSH_SFT_HASH_MIN_BLOCK_SIZE, SSH_SFT_REQUEST_MAX_NUM, SSH_SFT_REQUEST_MAX_SIZE
 
Method Summary
 Filecopy(Location dst)
          Copies the file represented by this object to the destination specified.
 Filecopy(Location dst, ProgressListener progress)
          Copies the file represented by this object to the destination specified, using the progress listener.
 FileAttributesgetAttributes()
          Returns a copy of the attributes of FileAttributes of this file
 StringgetGroup()
          Returns the group of the file represented by this object.
 LocationgetLocation()
          Returns the Location of this file.
 StringgetOwner()
          Returns the owner of the file represented by this object.
 StringgetPath()
          Returns the path to the file represented by this object.
 SessiongetSession()
          Returns the Session used for accessing to this file.
 longgetSize()
          Returns the size of the file represented by this object.
 URIgetURI()
          Returns the URI for this File.
 Filemove(Location dst)
          Moves the file represented by this object to the destination specified.
 voidremove()
          Removes the file that is represented by this object.
 Filerename(Location dst)
          Renames the file represented by this object.
 voidsetAttributes(FileAttributes attrs)
          Sets the file attributes to this file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SSH_SFT_FILE_TYPE_REGULAR

public static final int SSH_SFT_FILE_TYPE_REGULAR
See Also:
Constant Field Values

SSH_SFT_FILE_TYPE_DIRECTORY

public static final int SSH_SFT_FILE_TYPE_DIRECTORY
See Also:
Constant Field Values

SSH_SFT_FILE_TYPE_SYMLINK

public static final int SSH_SFT_FILE_TYPE_SYMLINK
See Also:
Constant Field Values

SSH_SFT_FILE_TYPE_SPECIAL

public static final int SSH_SFT_FILE_TYPE_SPECIAL
See Also:
Constant Field Values

SSH_SFT_FILE_TYPE_UNKNOWN

public static final int SSH_SFT_FILE_TYPE_UNKNOWN
See Also:
Constant Field Values
Method Detail

getAttributes

public FileAttributes getAttributes()
                             throws SftException
Returns a copy of the attributes of FileAttributes of this file

Returns:
A copy of the FileAttributes of this file.
Throws:
SftException

setAttributes

public void setAttributes(FileAttributes attrs)
                   throws SftException
Sets the file attributes to this file.

Parameters:
attrs - FileAttributes to be added to this file.
Throws:
SftException

getPath

public String getPath()
Returns the path to the file represented by this object.

Returns:
Path of the file.

getLocation

public Location getLocation()
Returns the Location of this file.

Returns:
the Location of this file

getOwner

public String getOwner()
                throws SftException
Returns the owner of the file represented by this object.

Returns:
Owner of the file.
Throws:
SftException

getGroup

public String getGroup()
                throws SftException
Returns the group of the file represented by this object.

Returns:
Group of the file.
Throws:
SftException

remove

public void remove()
            throws SftException
Removes the file that is represented by this object.

Throws:
SftException

copy

public File copy(Location dst)
          throws SftException
Copies the file represented by this object to the destination specified.

Parameters:
dst - Location to copy the file.
Returns:
Copied File.
Throws:
SftException

copy

public File copy(Location dst,
                 ProgressListener progress)
          throws SftException
Copies the file represented by this object to the destination specified, using the progress listener.

Parameters:
dst - Location to copy the file.
progress - ProgressListener object that will be used for tracking the file copy.
Returns:
Copied File.
Throws:
SftException

move

public File move(Location dst)
          throws SftException
Moves the file represented by this object to the destination specified.

Parameters:
dst - Location to copy the file.
Returns:
Moved File.
Throws:
SftException

rename

public File rename(Location dst)
            throws SftException
Renames the file represented by this object.

Parameters:
dst - Location specifying the renamed object.
Returns:
Renamed File.
Throws:
SftException

getURI

public URI getURI()
Returns the URI for this File. The URI is of the form "sftp://user@host:/path".

Returns:
the URI for this file.

getSession

public Session getSession()
Returns the Session used for accessing to this file.

Returns:
Session used by this object.

getSize

public long getSize()
             throws SftException
Returns the size of the file represented by this object.

Returns:
size of the file.
Throws:
SftException


===AUTO_SCHEMA_MARKUP===