ftp
Class FtpListResult

java.lang.Object
  |
  +--ftp.FtpListResult

public class FtpListResult
extends java.lang.Object

This class is used to parse the information of a returned String from the 'LIST' command.
It parse the following information from the list:
1) Name
2) Permission
3) Type
4) Owner
5) Group
6) Date
7) Size

Sample code for using this class:
while(ftplist.next())
{
System.out.println(ftplist.getName());
}


Normally, we can see two formats returned by the ftp LIST command.
One is the standard UNIX format, and another one is the MS-DOS format (rarely see).
This class can parse both formats. Unfortunely, the following information are missed in
the MS-DOS format:
1) Owner of file
note: getOwner() method returns "" all the time.
2) Group whihc own the file
note: getGroup() method returns "" all the time.
3) File permission
note: getPermission() method returns "" all the time.
Those methods like getOwnerReadable() returns true all the time.


Field Summary
static int BLK_DEV
           
static int CHAR_DEV
           
static int DIRECTORY
           
static int FILE
           
static int LINK
           
static int OTHERS
           
 
Constructor Summary
FtpListResult()
           
 
Method Summary
 java.lang.String getDate()
          Get the date
 int getFtBlkDev()
           
 int getFtCharDev()
           
 int getFtDir()
           
 int getFtFile()
           
 int getFtLink()
           
 java.lang.String getGroup()
          Get the name of the group which own the file, directory or link.
 java.lang.String getName()
          Get file name.
 java.lang.String getOwner()
          Get the user which own the file, directory or link.
 java.lang.String getPermission()
          Get permission.
 long getSize()
          Get size.
 int getType()
          Get the type.
 boolean globalExecutable()
          deprecated!
 boolean globalReadable()
          Deprecated!
 boolean globalWritable()
          Deprecated!
 boolean groupExecutable()
          deprecated!
 boolean groupReadable()
          deprecated!
 boolean groupWritable()
          deprecated!
 boolean isGlobalExecutable()
          Whether it is global executable.
 boolean isGlobalReadable()
          Whether it is global readable.
 boolean isGlobalWritable()
          Whether it is global writable.
 boolean isGroupExecutable()
          Whether it is executable by group.
 boolean isGroupReadable()
          Whether it is readable by group.
 boolean isGroupWritable()
          Whether it is writable by group.
 boolean isOwnerExecutable()
          Whether it is executable by owner.
 boolean isOwnerReadable()
          Whether it is readable by owner.
 boolean isOwnerWritable()
          Whether it is writable by owner.
 boolean next()
          A FtpListResult is initially positioned before its first row.
 boolean ownerExecutable()
          deprecated!
 boolean ownerReadable()
          deprecated!
 boolean ownerWritable()
          deprecated!
protected  void parseList(java.lang.String strlist, java.lang.String system_type)
          Parse the information from the string list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTORY

public static final int DIRECTORY
See Also:
Constant Field Values

FILE

public static final int FILE
See Also:
Constant Field Values

LINK

public static final int LINK
See Also:
Constant Field Values

BLK_DEV

public static final int BLK_DEV
See Also:
Constant Field Values

CHAR_DEV

public static final int CHAR_DEV
See Also:
Constant Field Values

OTHERS

public static final int OTHERS
See Also:
Constant Field Values
Constructor Detail

FtpListResult

public FtpListResult()
Method Detail

getFtBlkDev

public int getFtBlkDev()

getFtCharDev

public int getFtCharDev()

getFtFile

public int getFtFile()

getFtDir

public int getFtDir()

getFtLink

public int getFtLink()

getDate

public java.lang.String getDate()
Get the date


getGroup

public java.lang.String getGroup()
Get the name of the group which own the file, directory or link.


getName

public java.lang.String getName()
Get file name.


getOwner

public java.lang.String getOwner()
Get the user which own the file, directory or link.


getPermission

public java.lang.String getPermission()
Get permission.


getSize

public long getSize()
Get size.


getType

public int getType()
Get the type.

Returns:
the int DIRECTORY,FILE or LINK.

ownerReadable

public boolean ownerReadable()
deprecated! Use isOwnerReadable instead

Returns:
True if readable by owner.

isOwnerReadable

public boolean isOwnerReadable()
Whether it is readable by owner.

Returns:
True if readable by owner.

ownerWritable

public boolean ownerWritable()
deprecated! Use isOwnerWritable instead

Returns:
True if writable by owner.

isOwnerWritable

public boolean isOwnerWritable()
Whether it is writable by owner.

Returns:
True if writable by owner.

ownerExecutable

public boolean ownerExecutable()
deprecated! Use isOwnerExecutable instead

Returns:
True if executable by owner.

isOwnerExecutable

public boolean isOwnerExecutable()
Whether it is executable by owner.

Returns:
True if executable by owner.

groupReadable

public boolean groupReadable()
deprecated! Use isGroupReadable instead

Returns:
True if readable by group.

isGroupReadable

public boolean isGroupReadable()
Whether it is readable by group.

Returns:
True if readable by group.

groupWritable

public boolean groupWritable()
deprecated! Use isGroupWritable instead

Returns:
True if writable by group.

isGroupWritable

public boolean isGroupWritable()
Whether it is writable by group.

Returns:
True if writable by group.

groupExecutable

public boolean groupExecutable()
deprecated! Use isGroupExecutable instead

Returns:
True if executable by group.

isGroupExecutable

public boolean isGroupExecutable()
Whether it is executable by group.

Returns:
True if executable by group.

globalReadable

public boolean globalReadable()
Deprecated! Use isGlobalReadable instead

Returns:
True if global readable.

isGlobalReadable

public boolean isGlobalReadable()
Whether it is global readable.

Returns:
True if global readable.

globalWritable

public boolean globalWritable()
Deprecated! Use isGlobalWritable instead

Returns:
True if global writable.

isGlobalWritable

public boolean isGlobalWritable()
Whether it is global writable.

Returns:
True if global writable.

globalExecutable

public boolean globalExecutable()
deprecated! Use isGlobalExecutable instead

Returns:
True if global executable.

isGlobalExecutable

public boolean isGlobalExecutable()
Whether it is global executable.

Returns:
True if global executable.

next

public boolean next()
A FtpListResult is initially positioned before its first row. the first call to next makes the first row the current row; the second call makes the second row the current row, etc

Returns:
true if the new current row is valid; false if there are no more rows.

parseList

protected void parseList(java.lang.String strlist,
                         java.lang.String system_type)
Parse the information from the string list