com.ssh.sft
Class FileAttributes

java.lang.Object
  extended bycom.ssh.sft.SftLib
      extended bycom.ssh.sft.SftBase
          extended bycom.ssh.sft.FileAttributes
All Implemented Interfaces:
Cloneable, SftLibConstants, com.ssh.sft.SshSftFileType

public class FileAttributes
extends com.ssh.sft.SftBase
implements com.ssh.sft.SshSftFileType, Cloneable

A collection of file attributes. Instances of this class are records that collect various attributes that a file may have. The record is wholly transparent: the fields are public and the user may create and modify instances of this class. Not all attributes are always set. When a field has a value of null or -1, it indicates that the attribute is unset, i.e. not available or not meant to be modified.


Field Summary
 Date access_time
          The time of the last access to the file.
 Date create_time
          The time of creation of the file.
 long gid
          The group ID of the file.
 String group
          The name of the group of the file.
 Date modify_time
          The time of the last modificaction of the file.
 String owner
          The name of the owner of the file.
 long permissions
          The permissions of the file as a standard UNIX mode value.
 long size
          The size of the file in bytes.
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
           
 int type
          The type of the file.
 long uid
          The user ID of the file.
 
Fields inherited from interface com.ssh.sft.SftLibConstants
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
 
Constructor Summary
FileAttributes()
          Constructs a new FileAttributes object with all of the attributes initially unset.
 
Method Summary
 FileAttributes copy()
          Returns a new FileAttributes object with the same fields as this one.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public int type
The type of the file. One of SSH_SFT_FILE_TYPE_REGULAR, SSH_SFT_FILE_TYPE_DIRECTORY, SSH_SFT_FILE_TYPE_SYMLINK, SSH_SFT_FILE_TYPE_SPECIAL or SSH_SFT_FILE_TYPE_UNKNOWN.


size

public long size
The size of the file in bytes.


owner

public String owner
The name of the owner of the file. This attribute is only available when using version 4 or later of the SFTP protocol.


group

public String group
The name of the group of the file. This attribute is only available when using version 4 or later of the SFTP protocol.


uid

public long uid
The user ID of the file. This attribute is only available when using version 3 of the SFTP protocol.


gid

public long gid
The group ID of the file. This attribute is only available when using version 3 of the SFTP protocol.


create_time

public Date create_time
The time of creation of the file. This attribute is only available when using version 4 or later of the SFTP protocol. Even then this attribute is probably unset, as few SFTP servers or back-end filesystems support recording the creation time.


access_time

public Date access_time
The time of the last access to the file.


modify_time

public Date modify_time
The time of the last modificaction of the file.


permissions

public long permissions
The permissions of the file as a standard UNIX mode value.


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
Constructor Detail

FileAttributes

public FileAttributes()
Constructs a new FileAttributes object with all of the attributes initially unset.

Method Detail

copy

public FileAttributes copy()
Returns a new FileAttributes object with the same fields as this one.