|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.net.ftp.FTPFileListParserImpl | +--org.apache.commons.net.ftp.parser.VMSFTPEntryParser
This Class uses the FTPEntryParser class to validate the input string. It also requires the Commons/Net library version 1.0.0 or later and the Jakarta/ORO library for the regualar expressions stuff.
USAGE:
True
= returns all versions of a file with the respective
;#
False
= only the last version will return (Default)
filename
is a filename and versioning is OFF, the
version That's all there is to it.
Each FTPFile object is populated just like any other FTPFile object. The only thing not implemented at this time is the file permissions, but I can do it if there is a real need for it.
!NOTE/WARNING!:Before you pass the parser to listFiles, make sure you are in the directory that you need to be. This parser will return the filtered files from the directory it is in. This becomes crucial specialy if your goal is to delete the output of the parser.
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)",
Field Summary | |
---|---|
private static java.lang.String |
MONTHS
months abbreviations looked for by this parser. |
private static org.apache.oro.text.regex.Pattern |
OWNER_SPLIT_PATTERN
Pattern for splitting owner listing. |
private static java.lang.String |
REGEX
this is the regular expression used by this parser. |
private boolean |
versioning
settable option of whether or not to include versioning information with the file list. |
Fields inherited from class org.apache.commons.net.ftp.FTPFileListParserImpl |
---|
_matcher_ |
Constructor Summary | |
---|---|
VMSFTPEntryParser()
Convenience Constructor for a VMSFTPEntryParser object. |
|
VMSFTPEntryParser(boolean versioning)
Constructor for a VMSFTPEntryParser object. |
Method Summary | |
---|---|
FTPFile[] |
parseFileList(java.io.InputStream listStream)
Parses an FTP server file listing and converts it into a usable format in the form of an array of FTPFile instances. |
FTPFile |
parseFTPEntry(java.lang.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. |
java.lang.String |
readNextEntry(java.io.BufferedReader reader)
Reads the next entry using the supplied BufferedReader object up to whatever delemits one entry from the next. |
Methods inherited from class org.apache.commons.net.ftp.FTPFileListParserImpl |
---|
getGroupCnt, getGroupsAsString, group, matches |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean versioning
private static final java.lang.String MONTHS
private static final java.lang.String REGEX
private static final org.apache.oro.text.regex.Pattern OWNER_SPLIT_PATTERN
Constructor Detail |
public VMSFTPEntryParser()
versioning
member false
java.lang.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.public VMSFTPEntryParser(boolean versioning)
versioning
- Value to which versioning is to be set.
java.lang.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.Method Detail |
public FTPFile[] parseFileList(java.io.InputStream listStream) throws java.io.IOException
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.
parseFileList
in interface FTPFileListParser
parseFileList
in class FTPFileListParserImpl
listStream
- The InputStream from which the file list should be
read.
java.io.IOException
- If an I/O error occurs reading the listStream.public FTPFile parseFTPEntry(java.lang.String entry)
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.
entry
- A line of text from the file listing
public java.lang.String readNextEntry(java.io.BufferedReader reader) throws java.io.IOException
readNextEntry
in interface FTPFileEntryParser
readNextEntry
in class FTPFileListParserImpl
reader
- The BufferedReader object from which entries are to be
read.
java.io.IOException
- thrown on any IO Error reading from the reader.
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |