|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.myjavaworld.ftp.DefaultRemoteFile
public class DefaultRemoteFile
The default implementation of RemoteFile
interface.
Constructor Summary | |
---|---|
DefaultRemoteFile(String path)
Constructs a DefaultRemoteFile object. |
|
DefaultRemoteFile(String path,
boolean dir)
Constructs a DefaultRemoteFile object. |
|
DefaultRemoteFile(String parent,
String name)
Constructs a DefaultRemoteFile object. |
|
DefaultRemoteFile(String parent,
String name,
boolean dir)
Constructs a DefaultRemoteFile object. |
|
DefaultRemoteFile(String parent,
String name,
boolean dir,
long size,
long lastModified,
String attributes)
Constructs a DefaultRemoteFile object. |
|
DefaultRemoteFile(String parent,
String name,
boolean dir,
long size,
long lastModified,
String attributes,
int linkCount,
String owner,
String group)
Creates an instance of DefaultRemoteFile . |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
String |
getAttributes()
Returns the attributes of this file in standard unix format. |
String |
getExtension()
Returns the extension of this file. |
String |
getGroup()
Returns the group name to which the owner of this file belongs to. |
long |
getLastModified()
Returns the last modified date of this file in milli seconds. |
int |
getLinkCount()
Returns the number of links that point to this file. |
String |
getName()
Returns the name of this remote file. |
String |
getNormalizedName()
Returns the normalized name of this remote file. |
String |
getNormalizedPath()
Returns the normalized path. |
Hashtable |
getOtherProperties()
Returns additional properties of this file if any. |
String |
getOwner()
Returns the owner of this file. |
String |
getPath()
Returns the full path of this remote file. |
long |
getSize()
Returns the size of this file in bytes. |
String |
getType()
Returns the type of this file. |
boolean |
isDirectory()
Tells whether this file is a directory or not. |
boolean |
isFile()
Tells whether this file is a data file or not. |
boolean |
isLink()
Checkes to see if this file is symbolic link. |
void |
setAttributes(String attributes)
Sets the attributes on this file to the given attributes. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultRemoteFile(String path)
DefaultRemoteFile
object. The result object
will be marked as directory.
path
- Absolute path.public DefaultRemoteFile(String path, boolean dir)
DefaultRemoteFile
object.
path
- Absolute pathdir
- Whether or not this object is a directory.public DefaultRemoteFile(String parent, String name)
DefaultRemoteFile
object.
parent
- parent file.name
- File namepublic DefaultRemoteFile(String parent, String name, boolean dir)
DefaultRemoteFile
object.
parent
- Parent filename
- File namedir
- Whther or not this is a directorypublic DefaultRemoteFile(String parent, String name, boolean dir, long size, long lastModified, String attributes)
DefaultRemoteFile
object.
parent
- Parent filename
- File namedir
- Whether or not this is a directorysize
- Size of this file in byteslastModified
- Date and time this file is last modifiedattributes
- Attributes of this filepublic DefaultRemoteFile(String parent, String name, boolean dir, long size, long lastModified, String attributes, int linkCount, String owner, String group)
DefaultRemoteFile
.
parent
- parent file.name
- name of this file.dir
- whether this file is a directory or not.size
- Size of this file.lastModified
- Last modified dateattributes
- Attributes or permissions.linkCount
- symbolic link countowner
- Owner of this file.group
- Group to which the owner belongs to.Method Detail |
---|
public String getPath()
RemoteFile
getPath
in interface RemoteFile
public String getNormalizedPath()
RemoteFile
getNormalizedPath
in interface RemoteFile
public String getName()
RemoteFile
getName
in interface RemoteFile
public String getNormalizedName()
RemoteFile
getNormalizedName
in interface RemoteFile
public String getExtension()
RemoteFile
getExtension
in interface RemoteFile
public String getType()
RemoteFile
getType
in interface RemoteFile
public long getSize()
RemoteFile
getSize
in interface RemoteFile
public long getLastModified()
RemoteFile
getLastModified
in interface RemoteFile
public boolean isDirectory()
RemoteFile
isDirectory
in interface RemoteFile
true
, if this file is a directory.
false
otherwise.public boolean isFile()
RemoteFile
isFile
in interface RemoteFile
true
, if this file is a data file.
false
otherwise.public boolean isLink()
RemoteFile
isLink
in interface RemoteFile
true
, if this file is a symbolic link.
false
, otherwsie.public String getAttributes()
RemoteFile
getAttributes
in interface RemoteFile
public int getLinkCount()
RemoteFile
getLinkCount
in interface RemoteFile
public String getOwner()
RemoteFile
getOwner
in interface RemoteFile
public String getGroup()
RemoteFile
getGroup
in interface RemoteFile
public void setAttributes(String attributes)
RemoteFile
setAttributes
in interface RemoteFile
attributes
- new attributes to set.public String toString()
toString
in class Object
public Hashtable getOtherProperties()
RemoteFile
getOtherProperties
in interface RemoteFile
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |