com.mindbright.ssh2
Class SSH2SFTP.FileAttributes

java.lang.Object
  extended by com.mindbright.ssh2.SSH2SFTP.FileAttributes
Enclosing class:
SSH2SFTP

public static final class SSH2SFTP.FileAttributes
extends java.lang.Object

Class describing the different file attributes.

See Also:
SSH2SFTPClient

Field Summary
 int atime
          Time of last access
 int gid
          gid of file
 boolean hasModTime
          True if the mod time fiels has been initialized
 boolean hasName
          True if the name field has been initialized
 boolean hasPermissions
          True if the permissions field has been initialized
 boolean hasSize
          True if the size field has been initialized
 boolean hasUserGroup
          True if the user and group fields has been initialized
 java.lang.String ldest
          Only valid for symbolic links, the name the link points at
 int mtime
          Time of last modification
 java.lang.String name
          Name of file
 int permissions
          Permissions flags
static int S_IFBLK
          Block device flag, set if this is a block device
static int S_IFCHR
          Character device flag, set if this is a character device
static int S_IFDIR
          Directory flag, set if this is a directory
static int S_IFIFO
          FIFO flag, set if this is a FIFO pipe
static int S_IFLNK
          Link flag, set if this is a symbolic link
static int S_IFMT
          Format mask, used to mask off the format flags from the mode
static int S_IFREG
          Regular file flag, set if this is a regular file
static int S_IFSOCK
          Socket flag, set if this is a socket
static int S_IRGRP
          Group read rights bit
static int S_IROTH
          Other read rights bit
static int S_IRUSR
          User (owner) read rights bit
static int S_ISGID
          set-gid (SGID) flag
static int S_ISUID
          set-uid (SUID) flag
static int S_IWGRP
          Group write rights bit
static int S_IWOTH
          Other write rights bit
static int S_IWUSR
          User (owner) write rights bit
static int S_IXGRP
          Group execute rights bit
static int S_IXOTH
          Other execute rights bit
static int S_IXUSR
          User (owner) execute rights bit
 long size
          Size of file
 int uid
          uid of file
 
Constructor Summary
SSH2SFTP.FileAttributes()
           
 
Method Summary
 boolean isBlock()
          Returns true if this is a block device.
 boolean isCharacter()
          Returns true if this is a character device.
 boolean isDirectory()
          Returns true if this is a directory.
 boolean isFifo()
          Returns true if this is a FIFO pipe.
 boolean isFile()
          Returns true if this is a regular file.
 boolean isLink()
          Returns true if this is a symbolic link.
 boolean isSGID()
          Returns true if this object has the setgid flag set.
 boolean isSocket()
          Returns true if this is a socket.
 boolean isSUID()
          Returns true if this object has the setuid flag set.
 java.lang.String modTimeString()
          Print modification time in a format similar to that of ls -l.
 java.lang.String permString()
          Generate the permissions part of the ls -l simulated string.
 java.lang.String toString()
          Return a string identifying the file.
 java.lang.String toString(java.lang.String name)
          Return a string identifying the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

S_IFMT

public static final int S_IFMT
Format mask, used to mask off the format flags from the mode

See Also:
Constant Field Values

S_IFSOCK

public static final int S_IFSOCK
Socket flag, set if this is a socket

See Also:
Constant Field Values

S_IFLNK

public static final int S_IFLNK
Link flag, set if this is a symbolic link

See Also:
Constant Field Values

S_IFREG

public static final int S_IFREG
Regular file flag, set if this is a regular file

See Also:
Constant Field Values

S_IFBLK

public static final int S_IFBLK
Block device flag, set if this is a block device

See Also:
Constant Field Values

S_IFDIR

public static final int S_IFDIR
Directory flag, set if this is a directory

See Also:
Constant Field Values

S_IFCHR

public static final int S_IFCHR
Character device flag, set if this is a character device

See Also:
Constant Field Values

S_IFIFO

public static final int S_IFIFO
FIFO flag, set if this is a FIFO pipe

See Also:
Constant Field Values

S_ISUID

public static final int S_ISUID
set-uid (SUID) flag

See Also:
Constant Field Values

S_ISGID

public static final int S_ISGID
set-gid (SGID) flag

See Also:
Constant Field Values

S_IRUSR

public static final int S_IRUSR
User (owner) read rights bit

See Also:
Constant Field Values

S_IWUSR

public static final int S_IWUSR
User (owner) write rights bit

See Also:
Constant Field Values

S_IXUSR

public static final int S_IXUSR
User (owner) execute rights bit

See Also:
Constant Field Values

S_IRGRP

public static final int S_IRGRP
Group read rights bit

See Also:
Constant Field Values

S_IWGRP

public static final int S_IWGRP
Group write rights bit

See Also:
Constant Field Values

S_IXGRP

public static final int S_IXGRP
Group execute rights bit

See Also:
Constant Field Values

S_IROTH

public static final int S_IROTH
Other read rights bit

See Also:
Constant Field Values

S_IWOTH

public static final int S_IWOTH
Other write rights bit

See Also:
Constant Field Values

S_IXOTH

public static final int S_IXOTH
Other execute rights bit

See Also:
Constant Field Values

hasName

public boolean hasName
True if the name field has been initialized


hasSize

public boolean hasSize
True if the size field has been initialized


hasUserGroup

public boolean hasUserGroup
True if the user and group fields has been initialized


hasPermissions

public boolean hasPermissions
True if the permissions field has been initialized


hasModTime

public boolean hasModTime
True if the mod time fiels has been initialized


name

public java.lang.String name
Name of file


ldest

public java.lang.String ldest
Only valid for symbolic links, the name the link points at


size

public long size
Size of file


uid

public int uid
uid of file


gid

public int gid
gid of file


permissions

public int permissions
Permissions flags


atime

public int atime
Time of last access


mtime

public int mtime
Time of last modification

Constructor Detail

SSH2SFTP.FileAttributes

public SSH2SFTP.FileAttributes()
Method Detail

toString

public java.lang.String toString()
Return a string identifying the file. The generated string looks like the output of ls -l.

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String name)
Return a string identifying the file. The generated string looks like the output of ls -l.

Parameters:
name - name of file to print

permString

public java.lang.String permString()
Generate the permissions part of the ls -l simulated string.


modTimeString

public java.lang.String modTimeString()
Print modification time in a format similar to that of ls -l. That is for dates whiel is less than six months old "MMM dd hh:mm" and for older dates "MMM dd yyyy".


isSocket

public boolean isSocket()
Returns true if this is a socket.


isLink

public boolean isLink()
Returns true if this is a symbolic link.


isFile

public boolean isFile()
Returns true if this is a regular file.


isBlock

public boolean isBlock()
Returns true if this is a block device.


isDirectory

public boolean isDirectory()
Returns true if this is a directory.


isCharacter

public boolean isCharacter()
Returns true if this is a character device.


isFifo

public boolean isFifo()
Returns true if this is a FIFO pipe.


isSUID

public boolean isSUID()
Returns true if this object has the setuid flag set.


isSGID

public boolean isSGID()
Returns true if this object has the setgid flag set.