Secure FTP Factory

com.jscape.inet.ftp
Class AS400Parser

java.lang.Object
  extended by com.jscape.inet.ftp.AS400Parser
All Implemented Interfaces:
FtpFileParser

public class AS400Parser
extends java.lang.Object
implements FtpFileParser

Parser responsible for handling FTP directory listing returned in AS400 format. The following is a partial example listing of the format expected.

   agonzalez   1148    07/12/06  17:15:29   *DIR    Archive/
   agonzalez   1288    08/07/06  14:19:08   *STMF   eye.asc
   agonzalez   4096    01/01/70  02:00:00   *STMF   jaase
 
It ignores the i5 object groups entries and only parses the *DIR and *STMF entries


Constructor Summary
AS400Parser()
           
 
Method Summary
 java.util.Date getDateTime(FtpFile file)
          Gets the date and time for an FtpFile entry sourced from an AS400 directory listing.
 java.util.Date getFileDate(java.lang.String date)
          Parses a string which contains a date and returns a date object
 java.util.Enumeration parse(java.io.BufferedReader in)
          Parses directory listing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AS400Parser

public AS400Parser()
Method Detail

parse

public java.util.Enumeration parse(java.io.BufferedReader in)
                            throws java.io.IOException
Parses directory listing. Reads directory listing from FTP server and parses contents into an Enumeration of FtpFile.

Specified by:
parse in interface FtpFileParser
Parameters:
in - the BufferedReader passed in by Ftp class when invoking Ftp#getDirListing method.
Returns:
an Enumeration of FtpFile
Throws:
java.io.IOException - if an I/O or FTP related error occurs
See Also:
FtpFile, Ftp.getDirListing(java.lang.String)

getFileDate

public java.util.Date getFileDate(java.lang.String date)
                           throws java.text.ParseException
Parses a string which contains a date and returns a date object

Specified by:
getFileDate in interface FtpFileParser
Parameters:
date - The string will be parsed
Returns:
A object date which corresponds with the input string argument
Throws:
java.text.ParseException - if an error ocurrs

getDateTime

public java.util.Date getDateTime(FtpFile file)
                           throws java.text.ParseException
Gets the date and time for an FtpFile entry sourced from an AS400 directory listing.

Specified by:
getDateTime in interface FtpFileParser
Parameters:
file - the FtpFile
Throws:
java.text.ParseException - if an error occurs while parsing entry
See Also:
FtpFile

Secure FTP Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved