org.apache.commons.net.ftp
public class FTPFile extends Object implements Serializable
See Also: FTPFileListParser DefaultFTPFileListParser FTPClient
Field Summary | |
---|---|
static int | DIRECTORY_TYPE A constant indicating an FTPFile is a directory. |
static int | EXECUTE_PERMISSION
A constant indicating file execute permission or directory listing
permission.
|
static int | FILE_TYPE A constant indicating an FTPFile is a file. |
static int | GROUP_ACCESS A constant indicating group access permissions. |
static int | READ_PERMISSION A constant indicating file/directory read permission. |
static int | SYMBOLIC_LINK_TYPE A constant indicating an FTPFile is a symbolic link. |
static int | UNKNOWN_TYPE A constant indicating an FTPFile is of unknown type. |
static int | USER_ACCESS A constant indicating user access permissions. |
static int | WORLD_ACCESS A constant indicating world access permissions. |
static int | WRITE_PERMISSION A constant indicating file/directory write permission. |
Constructor Summary | |
---|---|
FTPFile() Creates an empty FTPFile. |
Method Summary | |
---|---|
String | getGroup()
Returns the name of the group owning the file. |
int | getHardLinkCount()
Return the number of hard links to this file. |
String | getLink()
If the FTPFile is a symbolic link, this method returns the name of the
file being pointed to by the symbolic link. |
String | getName()
Return the name of the file.
|
String | getRawListing()
Get the original FTP server raw listing used to initialize the FTPFile.
|
long | getSize()
Return the file size in bytes.
|
Calendar | getTimestamp()
Returns the file timestamp. |
int | getType()
Return the type of the file (one of the _TYPE constants),
e.g., if it is a directory, a regular file, or a symbolic link.
|
String | getUser()
Returns the name of the user owning the file. |
boolean | hasPermission(int access, int permission)
Determines if the given access group (one of the _ACCESS
constants) has the given access permission (one of the
_PERMISSION constants) to the file.
|
boolean | isDirectory()
Determine if the file is a directory.
|
boolean | isFile()
Determine if the file is a regular file.
|
boolean | isSymbolicLink()
Determine if the file is a symbolic link.
|
boolean | isUnknown()
Determine if the type of the file is unknown.
|
void | setGroup(String group)
Set the name of the group owning the file. |
void | setHardLinkCount(int links)
Set the number of hard links to this file. |
void | setLink(String link)
If the FTPFile is a symbolic link, use this method to set the name of the
file being pointed to by the symbolic link.
|
void | setName(String name)
Set the name of the file.
|
void | setPermission(int access, int permission, boolean value)
Set if the given access group (one of the _ACCESS
constants) has the given access permission (one of the
_PERMISSION constants) to the file.
|
void | setRawListing(String rawListing)
Set the original FTP server raw listing from which the FTPFile was
created.
|
void | setSize(long size)
Set the file size in bytes. |
void | setTimestamp(Calendar date)
Set the file timestamp. |
void | setType(int type)
Set the type of the file ( DIRECTORY_TYPE ,
FILE_TYPE , etc.).
|
void | setUser(String user)
Set the name of the user owning the file. |
String | toString()
Returns a string representation of the FTPFile information. |
Returns: The name of the group owning the file.
Returns: The number of hard links to this file.
Returns: The file pointed to by the symbolic link (null if the FTPFile is not a symbolic link).
Returns: The name of the file.
Returns: The original FTP server raw listing used to initialize the FTPFile.
Returns: The file size in bytes.
Returns: A Calendar instance representing the file timestamp.
_TYPE
constants),
e.g., if it is a directory, a regular file, or a symbolic link.
Returns: The type of the file.
Returns: The name of the user owning the file.
_ACCESS
constants) has the given access permission (one of the
_PERMISSION
constants) to the file.
Parameters: access The access group (one of the _ACCESS
constants) permission The access permission (one of the
_PERMISSION
constants)
Returns: True if the file is of type DIRECTORY_TYPE
, false if
not.
Returns: True if the file is of type FILE_TYPE
, false if
not.
Returns: True if the file is of type UNKNOWN_TYPE
, false if
not.
Returns: True if the file is of type UNKNOWN_TYPE
, false if
not.
Parameters: group The name of the group owning the file.
Parameters: links The number of hard links to this file.
Parameters: link The file pointed to by the symbolic link.
Parameters: name The name of the file.
_ACCESS
constants) has the given access permission (one of the
_PERMISSION
constants) to the file.
Parameters: access The access group (one of the _ACCESS
constants) permission The access permission (one of the
_PERMISSION
constants) value True if permission is allowed, false if not.
Parameters: rawListing The raw FTP server listing.
Parameters: size The file size in bytes.
Parameters: date A Calendar instance representing the file timestamp.
DIRECTORY_TYPE
,
FILE_TYPE
, etc.).
Parameters: type The integer code representing the type of the file.
Parameters: user The name of the user owning the file.
Returns: A string representation of the FTPFile information.