public class FtpListResult
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
static int |
BLK_DEV |
static int |
CHAR_DEV |
static int |
DIRECTORY |
static int |
FILE |
static int |
LINK |
static int |
OTHERS |
Constructor and Description |
---|
FtpListResult() |
Modifier and Type | Method and Description |
---|---|
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! Use isGlobalExecutable instead
|
boolean |
globalReadable()
Deprecated! Use isGlobalReadable instead
|
boolean |
globalWritable()
Deprecated! Use isGlobalWritable instead
|
boolean |
groupExecutable()
deprecated! Use isGroupExecutable instead
|
boolean |
groupReadable()
deprecated! Use isGroupReadable instead
|
boolean |
groupWritable()
deprecated! Use isGroupWritable instead
|
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! Use isOwnerExecutable instead
|
boolean |
ownerReadable()
deprecated! Use isOwnerReadable instead
|
boolean |
ownerWritable()
deprecated! Use isOwnerWritable instead
|
protected void |
parseList(java.lang.String strlist,
java.lang.String system_type)
Parse the information from the string list
|
public static final int DIRECTORY
public static final int FILE
public static final int LINK
public static final int BLK_DEV
public static final int CHAR_DEV
public static final int OTHERS
public int getFtBlkDev()
public int getFtCharDev()
public int getFtFile()
public int getFtDir()
public int getFtLink()
public java.lang.String getDate()
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 isOwnerReadable()
public boolean ownerWritable()
public boolean isOwnerWritable()
public boolean ownerExecutable()
public boolean isOwnerExecutable()
public boolean groupReadable()
public boolean isGroupReadable()
public boolean groupWritable()
public boolean isGroupWritable()
public boolean groupExecutable()
public boolean isGroupExecutable()
public boolean globalReadable()
public boolean isGlobalReadable()
public boolean globalWritable()
public boolean isGlobalWritable()
public boolean globalExecutable()
public boolean isGlobalExecutable()
public boolean next()
protected void parseList(java.lang.String strlist, java.lang.String system_type)