|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.globus.ftp.FileInfo
Represents the properties of a remote file such as size, name, modification date and time, etc. Can represent a regular file as well as a directory or a soft link.
Field Summary | |
static byte |
DEVICE_TYPE
|
static byte |
DIRECTORY_TYPE
|
static byte |
FILE_TYPE
|
static byte |
SOFTLINK_TYPE
|
static int |
UNKNOWN_NUMBER
|
static String |
UNKNOWN_STRING
|
static byte |
UNKNOWN_TYPE
|
Constructor Summary | |
FileInfo()
Used internally by the FTPClient. |
|
FileInfo(String unixListReply)
Parses the file information from one line of response to the FTP LIST command. |
Method Summary | |
boolean |
allCanExecute()
|
boolean |
allCanRead()
|
boolean |
allCanWrite()
|
String |
getDate()
Returns date of the file. |
int |
getMode()
|
String |
getModeAsString()
|
String |
getName()
Returns name of the file. |
long |
getSize()
Returns size of the file. |
String |
getTime()
Returns modification time of the file. |
boolean |
groupCanExecute()
|
boolean |
groupCanRead()
|
boolean |
groupCanWrite()
|
boolean |
isDevice()
Tests if this file is a device. |
boolean |
isDirectory()
Tests if this file is a directory. |
boolean |
isFile()
Tests if this file is a file. |
boolean |
isSoftLink()
Tests if this file is a softlink. |
void |
parseUnixListReply(String reply)
Given a line of reply received as the result of "LIST" command, this method will set all the attributes(name,size,time,date and file type) of the named file. |
void |
setDate(String date)
Sets the file date. |
void |
setFileType(byte type)
Sets the file type. |
void |
setName(String name)
Sets the file name. |
void |
setSize(long size)
Sets the file size. |
void |
setTime(String time)
Sets modification time of the file. |
String |
toString()
|
boolean |
userCanExecute()
|
boolean |
userCanRead()
|
boolean |
userCanWrite()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte UNKNOWN_TYPE
public static final byte FILE_TYPE
public static final byte DIRECTORY_TYPE
public static final byte SOFTLINK_TYPE
public static final byte DEVICE_TYPE
public static final String UNKNOWN_STRING
public static final int UNKNOWN_NUMBER
Constructor Detail |
public FileInfo()
public FileInfo(String unixListReply) throws FTPException
unixListReply
- a single line from ls -l commandparseUnixListReply(String reply)
Method Detail |
public void parseUnixListReply(String reply) throws FTPException
drwxr-xr-x 2 guest other 1536 Jan 31 15:15 run.bator
-rw-rw-r-- 1 globus 117579 Nov 29 13:24 AdGriP.pdfIf the entry corresponds to a device file, only the file type will be set and the other parameters will be set to UNKNOWN.
reply
- reply of FTP server for "dir" command.
FTPException
- if unable to parse the replypublic void setSize(long size)
size
- size of the filepublic void setName(String name)
name
- name of the file.public void setDate(String date)
date
- date of the file.public void setTime(String time)
time
- time of the file.public void setFileType(byte type)
type
- one of the file types,
e.g. FILE_TYPE, DIRECTORY_TYPEpublic long getSize()
public String getName()
public String getDate()
public String getTime()
public boolean isFile()
public boolean isDirectory()
public boolean isSoftLink()
public boolean isDevice()
public int getMode()
public String getModeAsString()
public boolean userCanRead()
public boolean userCanWrite()
public boolean userCanExecute()
public boolean groupCanRead()
public boolean groupCanWrite()
public boolean groupCanExecute()
public boolean allCanRead()
public boolean allCanWrite()
public boolean allCanExecute()
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |