Class FTPFileFactory

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

public class FTPFileFactory extends Object
Factory for creating FTPFile objects
Version:
$Revision$
Author:
Bruce Blackshaw
  • Field Details

  • Constructor Details

    • FTPFileFactory

      public FTPFileFactory(String system) throws FTPException
      Constructor
      Parameters:
      system - SYST string
      Throws:
      FTPException
    • FTPFileFactory

      public FTPFileFactory(FTPFileParser parser)
      Constructor. User supplied parser. Note that parser rotation (in case of a ParseException) is disabled if a parser is explicitly supplied
      Parameters:
      parser - the parser to use
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getVMSParser

      public VMSFileParser getVMSParser()
      Return a reference to the VMS parser being used. This allows the user to set VMS-specific settings on the parser.
      Returns:
      VMSFileParser object
    • addParser

      public void addParser(FTPFileParser parser)
      Rather than forcing a parser (as in the constructor that accepts a parser), this adds a parser to the list of those used.
      Parameters:
      parser - user supplied parser to add
    • setLocale

      public void setLocale(Locale locale)
      Set the locale for date parsing of listings
      Parameters:
      locale - locale to set
    • setLocales

      public void setLocales(Locale[] locales)
      Set the locales to try for date parsing of listings
      Parameters:
      locales - locales to try
    • detectParser

      public void detectParser(String[] files)
    • parse

      public FTPFile parse(String line) throws ParseException
      Parse a single line of file listing
      Parameters:
      line -
      Returns:
      FTPFile
      Throws:
      ParseException
    • parse

      public FTPFile[] parse(String[] files) throws ParseException
      Parse an array of raw file information returned from the FTP server
      Parameters:
      files - array of strings
      Returns:
      array of FTPFile objects
      Throws:
      ParseException
    • getSystem

      public String getSystem()
      Get the SYST string
      Returns:
      the system string.