BaH.FTPParser: Types Modinfo Source  

FTP list parser

This module is designed to parse FTP directory listings, returning a list of objects that represent files and directories.

Currently, the module can read the following types of FTP server listings :

Requirements

The BaH.RegEx module is required for list processing.

Usage

Create an instance of TFTPParserFactory, and use the parseList() method to parse the listing, returning a TList of TFilePath objects.

The listing should be passed in as a single String.

Types Summary

TFileAttributes File attributes.
TFilePath A specific File/Directory/Symbolic Link.
TFilePermissions File Permissions.
TFTPDateTime A date-time representation for FTP files and directories.
TFTPParserFactory Tries to determine the FTP server kind based on directory list, and provides a parser for it.

Types

Type TFileAttributes
DescriptionFile attributes.
Fields Summary
fType , group , modified , owner , permissions , size
Field fType:Int
DescriptionThe file type.
InformationOne of, FTP_TYPE_FILE, FTP_TYPE_DIRECTORY or FTP_TYPE_SYMBOLIC_LINK.
Field group:String
DescriptionThe group, if available.
Field modified:TFTPDateTime
DescriptionThe timestamp, if available.
Field owner:String
DescriptionThe owner/user, if available.
Field permissions:TFilePermissions
DescriptionThe file permissions, if available.
Field size:Long
DescriptionThe file size.

Type TFilePath
DescriptionA specific File/Directory/Symbolic Link.
Fields Summary
absolutePath , attributes , name , symbolic
Methods Summary
isDir Returns true if this is a directory.
isFile Returns True if this is a file.
isSymbolic Returns True if this is a symbolic link.
Functions Summary
Create Creates a new TFilePath, with an option parent.
Field absolutePath:String
DescriptionThe absolute path of this TFilePath.
Field attributes:TFileAttributes
DescriptionThe attributes.
InformationSee TFileAttributes.
Field name:String
DescriptionThe name of this TFilePath.
Field symbolic:String
DescriptionThe symbolic link that this TFilePath points to, if appropriate.
Method isDir:Int()
DescriptionReturns true if this is a directory.
Method isFile:Int()
DescriptionReturns True if this is a file.
Method isSymbolic:Int()
DescriptionReturns True if this is a symbolic link.
Function Create:TFilePath(parent:TFilePath = Null)
DescriptionCreates a new TFilePath, with an option parent.
InformationThe parent will deteremine the proper absolutePath value.

Type TFilePermissions
DescriptionFile Permissions.

Type TFTPDateTime
DescriptionA date-time representation for FTP files and directories.

Type TFTPParserFactory
DescriptionTries to determine the FTP server kind based on directory list, and provides a parser for it.
InformationCurrent FTP servers supported : Unix, Netware, Enterprise Unix, NT, MVS, OS2, OS400 and VMS.
Methods Summary
clearCache Clears the parser cache, forcing it to re-test the next time parseList is invoked.
parseList Parse the directory list (as a multi-line String)
Functions Summary
Create Creates a new TFTPParserFactory object.
Method clearCache()
DescriptionClears the parser cache, forcing it to re-test the next time parseList is invoked.
Method parseList:TList(parent:TFilePath, list:String)
DescriptionParse the directory list (as a multi-line String)
InformationWill try different parsers until it finds one that works on the list. Once found, it reuses that specific parser from that point on every call to this method.
Function Create:TFTPParserFactory()
DescriptionCreates a new TFTPParserFactory object.

Module Information

Version1.00
AuthorBruce A Henderson
LicenseApache 2.0
Copyright2007 Bruce A Henderson
ModserverBRL
History1.00
HistoryBased on Apache Commons FTP Parsers and Cyberduck source