Class FTPFile

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

public class FTPFile extends Object
Represents a remote file (implementation)
Version:
$Revision$
Author:
Bruce Blackshaw
  • Field Details

    • cvsId

      protected static final String cvsId
      Revision control id
      See Also:
    • UNKNOWN

      public static final int UNKNOWN
      Unknown remote server type
      See Also:
    • WINDOWS

      public static final int WINDOWS
      Windows type
      See Also:
    • UNIX

      public static final int UNIX
      UNIX type
      See Also:
    • VMS

      public static final int VMS
      VMS type
      See Also:
    • 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 Details

    • 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 Details

    • 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.
    • 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

      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()
      Deprecated.
      Returns:
      Returns the linked name.
    • getLinkedName

      public String getLinkedName()
      Returns:
      Returns the linked name.
    • 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()
      Returns:
      Full path of file, including the directory, file-name and extension.
    • setPath

      public void setPath(String path)
      Set the path of the file. The path should include the directory, file-name and extension.
      Parameters:
      path - Full path of the file.