Fields Summary |
---|
public static final int | FILE_TYPEA constant indicating an FTPFile is a file. |
public static final int | DIRECTORY_TYPEA constant indicating an FTPFile is a directory. |
public static final int | SYMBOLIC_LINK_TYPEA constant indicating an FTPFile is a symbolic link. |
public static final int | UNKNOWN_TYPEA constant indicating an FTPFile is of unknown type. |
public static final int | USER_ACCESSA constant indicating user access permissions. |
public static final int | GROUP_ACCESSA constant indicating group access permissions. |
public static final int | WORLD_ACCESSA constant indicating world access permissions. |
public static final int | READ_PERMISSIONA constant indicating file/directory read permission. |
public static final int | WRITE_PERMISSIONA constant indicating file/directory write permission. |
public static final int | EXECUTE_PERMISSIONA constant indicating file execute permission or directory listing
permission. |
int | _type |
int | _hardLinkCount |
long | _size |
String | _rawListing |
String | _user |
String | _group |
String | _name |
String | _link |
Calendar | _date |
boolean[] | _permissions |
Methods Summary |
---|
public java.lang.String | getGroup()Returns the name of the group owning the file. Sometimes this will be
a string representation of the group number.
return _group;
|
public int | getHardLinkCount()Return the number of hard links to this file. This is not to be
confused with symbolic links.
return _hardLinkCount;
|
public java.lang.String | getLink()If the FTPFile is a symbolic link, this method returns the name of the
file being pointed to by the symbolic link. Otherwise it returns null.
return _link;
|
public java.lang.String | getName()Return the name of the file.
return _name;
|
public java.lang.String | getRawListing()Get the original FTP server raw listing used to initialize the FTPFile.
return _rawListing;
|
public long | getSize()Return the file size in bytes.
return _size;
|
public java.util.Calendar | getTimestamp()Returns the file timestamp. This usually the last modification time.
return _date;
|
public 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.
return _type;
|
public java.lang.String | getUser()Returns the name of the user owning the file. Sometimes this will be
a string representation of the user number.
return _user;
|
public 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.
return _permissions[access][permission];
|
public boolean | isDirectory()Determine if the file is a directory.
return (_type == DIRECTORY_TYPE);
|
public boolean | isFile()Determine if the file is a regular file.
return (_type == FILE_TYPE);
|
public boolean | isSymbolicLink()Determine if the file is a symbolic link.
return (_type == SYMBOLIC_LINK_TYPE);
|
public boolean | isUnknown()Determine if the type of the file is unknown.
return (_type == UNKNOWN_TYPE);
|
public void | setGroup(java.lang.String group)Set the name of the group owning the file. This may be
a string representation of the group number.
_group = group;
|
public void | setHardLinkCount(int links)Set the number of hard links to this file. This is not to be
confused with symbolic links.
_hardLinkCount = links;
|
public void | setLink(java.lang.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.
_link = link;
|
public void | setName(java.lang.String name)Set the name of the file.
_name = name;
|
public 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.
_permissions[access][permission] = value;
|
public void | setRawListing(java.lang.String rawListing)Set the original FTP server raw listing from which the FTPFile was
created.
_rawListing = rawListing;
|
public void | setSize(long size)Set the file size in bytes.
_size = size;
|
public void | setTimestamp(java.util.Calendar date)Set the file timestamp. This usually the last modification time.
The parameter is not cloned, so do not alter its value after calling
this method.
_date = date;
|
public void | setType(int type)Set the type of the file (DIRECTORY_TYPE ,
FILE_TYPE , etc.).
_type = type;
|
public void | setUser(java.lang.String user)Set the name of the user owning the file. This may be
a string representation of the user number;
_user = user;
|
public java.lang.String | toString()Returns a string representation of the FTPFile information. This
will be the raw FTP server listing that was used to initialize the
FTPFile instance.
return _rawListing;
|