org.apache.commons.net.ftp.parser

Class VMSFTPEntryParser

public class VMSFTPEntryParser extends ConfigurableFTPFileEntryParserImpl

Implementation FTPFileEntryParser and FTPFileListParser for VMS Systems. This is a sample of VMS LIST output "1-JUN.LIS;1 9/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)", "1-JUN.LIS;2 9/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)", "DATA.DIR;1 1/9 2-JUN-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)",

Note: VMSFTPEntryParser can only be instantiated through the DefaultFTPParserFactory by classname. It will not be chosen by the autodetection scheme.

Version: $Id: VMSFTPEntryParser.java 658518 2008-05-21 01:04:30Z sebb $

Author: Winston Ojeda Steve Cohen Stephane ESTE-GRACIAS

See Also: FTPFileEntryParser (for usage instructions) DefaultFTPFileEntryParserFactory

Constructor Summary
VMSFTPEntryParser()
Constructor for a VMSFTPEntryParser object.
VMSFTPEntryParser(FTPClientConfig config)
This constructor allows the creation of a VMSFTPEntryParser object with something other than the default configuration.
Method Summary
protected booleanisVersioning()
FTPFile[]parseFileList(InputStream listStream)
Parses an FTP server file listing and converts it into a usable format in the form of an array of FTPFile instances.
FTPFileparseFTPEntry(String entry)
Parses a line of a VMS FTP server file listing and converts it into a usable format in the form of an FTPFile instance.

Constructor Detail

VMSFTPEntryParser

public VMSFTPEntryParser()
Constructor for a VMSFTPEntryParser object.

Throws: IllegalArgumentException Thrown if the regular expression is unparseable. Should not be seen under normal conditions. It it is seen, this is a sign that REGEX is not a valid regular expression.

VMSFTPEntryParser

public VMSFTPEntryParser(FTPClientConfig config)
This constructor allows the creation of a VMSFTPEntryParser object with something other than the default configuration.

Parameters: config The configuration object used to configure this parser.

Throws: IllegalArgumentException Thrown if the regular expression is unparseable. Should not be seen under normal conditions. It it is seen, this is a sign that REGEX is not a valid regular expression.

Since: 1.4

Method Detail

isVersioning

protected boolean isVersioning()

parseFileList

public FTPFile[] parseFileList(InputStream listStream)
Parses an FTP server file listing and converts it into a usable format in the form of an array of FTPFile instances. If the file list contains no files, null should be returned, otherwise an array of FTPFile instances representing the files in the directory is returned.

Parameters: listStream The InputStream from which the file list should be read.

Returns: The list of file information contained in the given path. null if the list could not be obtained or if there are no files in the directory.

Throws: IOException If an I/O error occurs reading the listStream.

parseFTPEntry

public FTPFile parseFTPEntry(String entry)
Parses a line of a VMS FTP server file listing and converts it into a usable format in the form of an FTPFile instance. If the file listing line doesn't describe a file, null is returned, otherwise a FTPFile instance representing the files in the directory is returned.

Parameters: entry A line of text from the file listing

Returns: An FTPFile instance corresponding to the supplied entry