| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.ssh.sft
Class File
java.lang.Objectcom.ssh.sft.SftLib
com.ssh.sft.SftBase
com.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
- extends com.ssh.sft.SftBase
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 int | SSH_SFT_FILE_TYPE_DIRECTORY |
static int | SSH_SFT_FILE_TYPE_REGULAR |
static int | SSH_SFT_FILE_TYPE_SPECIAL |
static int | SSH_SFT_FILE_TYPE_SYMLINK |
static int | SSH_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 | |
File | copy(Location dst) Copies the file represented by this object to the destination specified. |
File | copy(Location dst, ProgressListener progress) Copies the file represented by this object to the destination specified, using the progress listener. |
FileAttributes | getAttributes() Returns a copy of the attributes of FileAttributes of this file |
String | getGroup() Returns the group of the file represented by this object. |
Location | getLocation() Returns the Location of this file. |
String | getOwner() Returns the owner of the file represented by this object. |
String | getPath() Returns the path to the file represented by this object. |
Session | getSession() Returns the Session used for accessing to this file. |
long | getSize() Returns the size of the file represented by this object. |
URI | getURI() Returns the URI for this File. |
File | move(Location dst) Moves the file represented by this object to the destination specified. |
void | remove() Removes the file that is represented by this object. |
File | rename(Location dst) Renames the file represented by this object. |
void | setAttributes(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()
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()
getSize
public long getSize() throws SftException
- Returns the size of the file represented by this object.
- Returns:
- size of the file.
- Throws:
SftException
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |