Package com.enterprisedt.net.ftp
Class FTPFile
java.lang.Object
com.enterprisedt.net.ftp.FTPFile
Represents a remote file (implementation)
- Version:
- $Revision$
- Author:
- Bruce Blackshaw
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DateCreated timeprotected static final StringRevision control idprotected StringGroup if knownprotected booleanIs this a directory?protected booleanIs this file a symbolic link?protected DateLast modifiedprotected intNumber of links to fileprotected StringName of file this is linked toprotected StringFile/dir nameprotected StringOwner if knownprotected StringDirectory if knownprotected StringPermission bits stringprotected StringRaw stringprotected longSize of filestatic final intUNIX typestatic final intUnknown remote server typestatic final intVMS typestatic final intWindows type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreated()Get the created date for the file.getGroup()intDeprecated.getName()getOwner()getPath()getRaw()intgetType()Deprecated.No longer necessary.booleanisDir()booleanisFile()Is this a file (and not a directory or a link).booleanisLink()FTPFile[]Returns an array of FTPFile objects denoting the files and directories in this directoryvoidsetCreated(Date date) Set the created datevoidsetDir(boolean isDir) voidvoidsetLastModified(Date date) Set the last modified datevoidsetLink(boolean isLink) voidsetLinkCount(int linkCount) voidsetLinkedName(String linkedname) voidSet the name of the filevoidvoidSet the path of the file.voidsetPermissions(String permissions) voidsetSize(long size) longsize()toString()
-
Field Details
-
cvsId
Revision control id- See Also:
-
UNKNOWN
public static final int UNKNOWNUnknown remote server type- See Also:
-
WINDOWS
public static final int WINDOWSWindows type- See Also:
-
UNIX
public static final int UNIXUNIX type- See Also:
-
VMS
public static final int VMSVMS type- See Also:
-
isLink
protected boolean isLinkIs this file a symbolic link? -
linkCount
protected int linkCountNumber of links to file -
permissions
Permission bits string -
isDir
protected boolean isDirIs this a directory? -
size
protected long sizeSize of file -
name
File/dir name -
linkedname
Name of file this is linked to -
owner
Owner if known -
group
Group if known -
lastModified
Last modified -
created
Created time -
raw
Raw string -
path
Directory if known
-
-
Constructor Details
-
FTPFile
Deprecated.'type' no longer used.Constructor- Parameters:
type- type of fileraw- raw string returned from servername- name of filesize- size of fileisDir- true if a directorylastModified- last modified timestamp
-
FTPFile
Constructor- Parameters:
raw- raw string returned from servername- name of filesize- size of fileisDir- true if a directorylastModified- last modified timestamp
-
FTPFile
Constructor- Parameters:
raw- raw string returned from server
-
-
Method Details
-
listFiles
Returns an array of FTPFile objects denoting the files and directories in this directory- Returns:
- FTPFile array
-
getType
public int getType()Deprecated.No longer necessary.Get the type of file, i.e UNIX- Returns:
- the integer type of the file
-
getGroup
- Returns:
- Returns the group.
-
isDir
public boolean isDir()- Returns:
- Returns the isDir.
-
isFile
public boolean isFile()Is this a file (and not a directory or a link).- Returns:
- true if a file, false if link or directory
-
lastModified
- Returns:
- Returns the lastModified date.
-
setLastModified
Set the last modified date- Parameters:
date- last modified date
-
created
Get the created date for the file. This is not supported by many servers, e.g. Unix does not record the created date of a file.- Returns:
- Returns the created date.
-
setCreated
Set the created date- Parameters:
date-
-
getName
- Returns:
- Returns the name.
-
setName
Set the name of the file- Parameters:
name- name of file
-
getOwner
- Returns:
- Returns the owner.
-
getRaw
- Returns:
- Returns the raw server string.
-
size
public long size()- Returns:
- Returns the size.
-
setSize
public void setSize(long size) -
getPermissions
- Returns:
- Returns the permissions.
-
isLink
public boolean isLink()- Returns:
- Returns true if file is a symlink
-
getLinkCount
public int getLinkCount()- Returns:
- Returns the number of links to the file
-
getLinkedname
Deprecated.- Returns:
- Returns the linked name.
-
getLinkedName
- Returns:
- Returns the linked name.
-
setGroup
- Parameters:
group- The group to set.
-
setDir
public void setDir(boolean isDir) - Parameters:
isDir- The isDir to set.
-
setLink
public void setLink(boolean isLink) - Parameters:
isLink- The isLink to set.
-
setLinkedName
- Parameters:
linkedname- The linked name to set.
-
setOwner
- Parameters:
owner- The owner to set.
-
setPermissions
- Parameters:
permissions- The permissions to set.
-
setLinkCount
public void setLinkCount(int linkCount) - Parameters:
linkCount- new link count
-
toString
-
getPath
- Returns:
- Full path of file, including the directory, file-name and extension.
-
setPath
Set the path of the file. The path should include the directory, file-name and extension.- Parameters:
path- Full path of the file.
-