edtFTPj

com.enterprisedt.net.ftp
Class FTPFile

java.lang.Object
  extended by com.enterprisedt.net.ftp.FTPFile

public class FTPFile
extends Object

Represents a remote file (implementation)

Version:
$Revision: 1.15 $
Author:
Bruce Blackshaw

Field Summary
protected  Date created
          Created time
protected static String cvsId
          Revision control id
protected  String group
          Group if known
protected  boolean isDir
          Is this a directory?
protected  boolean isLink
          Is this file a symbolic link?
protected  Date lastModified
          Last modified
protected  int linkCount
          Number of links to file
protected  String linkedname
          Name of file this is linked to
protected  String name
          File/dir name
protected  String owner
          Owner if known
protected  String path
          Directory if known
protected  String permissions
          Permission bits string
protected  String raw
          Raw string
protected  long size
          Size of file
static int UNIX
          UNIX type
static int UNKNOWN
          Unknown remote server type
static int VMS
          VMS type
static int WINDOWS
          Windows type
 
Constructor Summary
FTPFile(int type, String raw, String name, long size, boolean isDir, Date lastModified)
          Deprecated. 'type' no longer used.
FTPFile(String raw)
          Constructor
FTPFile(String raw, String name, long size, boolean isDir, Date lastModified)
          Constructor
 
Method Summary
 Date created()
          Get the created date for the file.
 String getGroup()
           
 int getLinkCount()
           
 String getLinkedname()
           
 String getName()
           
 String getOwner()
           
 String getPath()
           
 String getPermissions()
           
 String getRaw()
           
 int getType()
          Deprecated. No longer necessary.
 boolean isDir()
           
 boolean isLink()
           
 Date lastModified()
           
 FTPFile[] listFiles()
          Returns an array of FTPFile objects denoting the files and directories in this directory
 void setCreated(Date date)
          Set the created date
 void setDir(boolean isDir)
           
 void setGroup(String group)
           
 void setLastModified(Date date)
          Set the last modified date
 void setLink(boolean isLink)
           
 void setLinkCount(int linkCount)
           
 void setLinkedName(String linkedname)
           
 void setName(String name)
          Set the name of the file
 void setOwner(String owner)
           
 void setPath(String path)
           
 void setPermissions(String permissions)
           
 void setSize(long size)
           
 long size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cvsId

protected static final String cvsId
Revision control id

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Unknown remote server type

See Also:
Constant Field Values

WINDOWS

public static final int WINDOWS
Windows type

See Also:
Constant Field Values

UNIX

public static final int UNIX
UNIX type

See Also:
Constant Field Values

VMS

public static final int VMS
VMS type

See Also:
Constant Field Values

isLink

protected boolean isLink
Is this file a symbolic link?


linkCount

protected int linkCount
Number of links to file


permissions

protected String permissions
Permission bits string


isDir

protected boolean isDir
Is this a directory?


size

protected long size
Size of file


name

protected String name
File/dir name


linkedname

protected String linkedname
Name of file this is linked to


owner

protected String owner
Owner if known


group

protected String group
Group if known


lastModified

protected Date lastModified
Last modified


created

protected Date created
Created time


raw

protected String raw
Raw string


path

protected String path
Directory if known

Constructor Detail

FTPFile

public FTPFile(int type,
               String raw,
               String name,
               long size,
               boolean isDir,
               Date lastModified)
Deprecated. 'type' no longer used.

Constructor

Parameters:
type - type of file
raw - raw string returned from server
name - name of file
size - size of file
isDir - true if a directory
lastModified - last modified timestamp

FTPFile

public FTPFile(String raw,
               String name,
               long size,
               boolean isDir,
               Date lastModified)
Constructor

Parameters:
raw - raw string returned from server
name - name of file
size - size of file
isDir - true if a directory
lastModified - last modified timestamp

FTPFile

public FTPFile(String raw)
Constructor

Parameters:
raw - raw string returned from server
Method Detail

listFiles

public FTPFile[] 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

public String getGroup()
Returns:
Returns the group.

isDir

public boolean isDir()
Returns:
Returns the isDir.

lastModified

public Date lastModified()
Returns:
Returns the lastModified date.

setLastModified

public void setLastModified(Date date)
Set the last modified date

Parameters:
date - last modified date

created

public 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

public void setCreated(Date date)
Set the created date

Parameters:
date -

getName

public String getName()
Returns:
Returns the name.

setName

public void setName(String name)
Set the name of the file

Parameters:
name - name of file

getOwner

public String getOwner()
Returns:
Returns the owner.

getRaw

public String getRaw()
Returns:
Returns the raw server string.

size

public long size()
Returns:
Returns the size.

setSize

public void setSize(long size)

getPermissions

public String 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

public String getLinkedname()
Returns:
Returns the linkedname.

setGroup

public void setGroup(String group)
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

public void setLinkedName(String linkedname)
Parameters:
linkedname - The linked name to set.

setOwner

public void setOwner(String owner)
Parameters:
owner - The owner to set.

setPermissions

public void setPermissions(String permissions)
Parameters:
permissions - The permissions to set.

setLinkCount

public void setLinkCount(int linkCount)
Parameters:
linkCount - new link count

toString

public String toString()
Overrides:
toString in class Object
Returns:
string representation

getPath

public String getPath()

setPath

public void setPath(String path)

edtFTPj

Copyright © 2000-2007 Enterprise Distributed Technologies. All Rights Reserved.