|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ftp.FtpListResult
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) 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 |
DIRECTORY
|
static int |
FILE
|
static int |
LINK
|
static int |
OTHERS
|
Constructor Summary | |
FtpListResult()
|
Method Summary | |
java.lang.String |
getGroup()
Get the name of the group which own the file, directory or link. |
java.lang.String |
getName()
Get 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()
Whether it is global executable. |
boolean |
globalReadable()
Whether it is global readable. |
boolean |
globalWritable()
Whether it is global writable. |
boolean |
groupExecutable()
Whether it is executable by group. |
boolean |
groupReadable()
Whether it is readable by group. |
boolean |
groupWritable()
Whether it is writable by group. |
boolean |
next()
A FtpListResult is initially positioned before its first row. |
boolean |
ownerExecutable()
Whether it is executable by owner. |
boolean |
ownerReadable()
Whether it is readable by owner. |
boolean |
ownerWritable()
Whether it is writable by owner. |
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 |
public static final int DIRECTORY
public static final int FILE
public static final int LINK
public static final int OTHERS
Constructor Detail |
public FtpListResult()
Method Detail |
public java.lang.String getGroup()
public java.lang.String getName()
public java.lang.String getOwner()
public java.lang.String getPermission()
public long getSize()
public int getType()
public boolean ownerReadable()
public boolean ownerWritable()
public boolean ownerExecutable()
public boolean groupReadable()
public boolean groupWritable()
public boolean groupExecutable()
public boolean globalReadable()
public boolean globalWritable()
public boolean globalExecutable()
public boolean next()
protected void parseList(java.lang.String strlist, java.lang.String system_type)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |