public class MVSFTPEntryParser extends ConfigurableFTPFileEntryParserImpl
FTPFileEntryParser (for
usage instructions)
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
DEFAULT_DATE_FORMAT
Dates are ignored for file lists, but are used for member lists where
possible
|
(package private) static java.lang.String |
FILE_LIST_REGEX
Matches these entries:
|
(package private) static int |
FILE_LIST_TYPE |
private int |
isType |
(package private) static java.lang.String |
JES_LEVEL_1_LIST_REGEX
Matches these entries, note: no header:
|
(package private) static int |
JES_LEVEL_1_LIST_TYPE |
(package private) static java.lang.String |
JES_LEVEL_2_LIST_REGEX
JES INTERFACE LEVEL 2 parser
Matches these entries:
|
(package private) static int |
JES_LEVEL_2_LIST_TYPE |
(package private) static java.lang.String |
MEMBER_LIST_REGEX
Matches these entries:
|
(package private) static int |
MEMBER_LIST_TYPE |
(package private) static int |
UNIX_LIST_TYPE |
private UnixFTPEntryParser |
unixFTPEntryParser
Fallback parser for Unix-style listings
|
(package private) static int |
UNKNOWN_LIST_TYPE |
_matcher_
Constructor and Description |
---|
MVSFTPEntryParser()
The sole constructor for a MVSFTPEntryParser object.
|
Modifier and Type | Method and Description |
---|---|
protected FTPClientConfig |
getDefaultConfiguration()
Each concrete subclass must define this member to create
a default configuration to be used when that subclass is
instantiated without a
FTPClientConfig
parameter being specified. |
private boolean |
parseFileList(FTPFile file,
java.lang.String entry)
Parse entries representing a dataset list.
|
FTPFile |
parseFTPEntry(java.lang.String entry)
Parses a line of an z/OS - MVS FTP server file listing and converts it
into a usable format in the form of an
FTPFile instance. |
private boolean |
parseJeslevel1List(FTPFile file,
java.lang.String entry)
Matches these entries, note: no header:
|
private boolean |
parseJeslevel2List(FTPFile file,
java.lang.String entry)
Matches these entries:
|
private boolean |
parseMemberList(FTPFile file,
java.lang.String entry)
Parse entries within a partitioned dataset.
|
private boolean |
parseSimpleEntry(FTPFile file,
java.lang.String entry)
Assigns the name to the first word of the entry.
|
private boolean |
parseUnixList(FTPFile file,
java.lang.String entry)
Parse the entry as a standard unix file.
|
java.util.List<java.lang.String> |
preParse(java.util.List<java.lang.String> orig)
preParse is called as part of the interface.
|
(package private) void |
setType(int type)
Explicitly set the type of listing being processed.
|
configure, parseTimestamp
getGroupCnt, getGroupsAsString, group, matches, setRegex, setRegex
readNextEntry
static final int UNKNOWN_LIST_TYPE
static final int FILE_LIST_TYPE
static final int MEMBER_LIST_TYPE
static final int UNIX_LIST_TYPE
static final int JES_LEVEL_1_LIST_TYPE
static final int JES_LEVEL_2_LIST_TYPE
private int isType
private UnixFTPEntryParser unixFTPEntryParser
static final java.lang.String DEFAULT_DATE_FORMAT
static final java.lang.String FILE_LIST_REGEX
Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname B10142 3390 2006/03/20 2 31 F 80 80 PS MDI.OKL.WORK
static final java.lang.String MEMBER_LIST_REGEX
Name VV.MM Created Changed Size Init Mod Id TBSHELF 01.03 2002/09/12 2002/10/11 09:37 11 11 0 KIL001
static final java.lang.String JES_LEVEL_1_LIST_REGEX
IBMUSER1 JOB01906 OUTPUT 3 Spool Files 012345678901234567890123456789012345678901234 1 2 3 4
static final java.lang.String JES_LEVEL_2_LIST_REGEX
JOBNAME JOBID OWNER STATUS CLASS IBMUSER1 JOB01906 IBMUSER OUTPUT A RC=0000 3 spool files IBMUSER TSU01830 IBMUSER OUTPUT TSU ABEND=522 3 spool filesSample output from FTP session:
ftp> quote site filetype=jes 200 SITE command was accepted ftp> ls 200 Port request OK. 125 List started OK for JESJOBNAME=IBMUSER*, JESSTATUS=ALL and JESOWNER=IBMUSER JOBNAME JOBID OWNER STATUS CLASS IBMUSER1 JOB01906 IBMUSER OUTPUT A RC=0000 3 spool files IBMUSER TSU01830 IBMUSER OUTPUT TSU ABEND=522 3 spool files 250 List completed successfully. ftp> ls job01906 200 Port request OK. 125 List started OK for JESJOBNAME=IBMUSER*, JESSTATUS=ALL and JESOWNER=IBMUSER JOBNAME JOBID OWNER STATUS CLASS IBMUSER1 JOB01906 IBMUSER OUTPUT A RC=0000 -------- ID STEPNAME PROCSTEP C DDNAME BYTE-COUNT 001 JES2 A JESMSGLG 858 002 JES2 A JESJCL 128 003 JES2 A JESYSMSG 443 3 spool files 250 List completed successfully.
public MVSFTPEntryParser()
public FTPFile parseFTPEntry(java.lang.String entry)
FTPFile
instance.
If the file listing line doesn't describe a file, then
null
is returned. Otherwise a FTPFile
instance representing the file is returned.entry
- A line of text from the file listingprivate boolean parseFileList(FTPFile file, java.lang.String entry)
file
- will be updated with Name, Type, Timestamp if parsed.entry
- zosDirectoryEntryprivate boolean parseMemberList(FTPFile file, java.lang.String entry)
0 1 2 3 4 5 6 7 8 Name VV.MM Created Changed Size Init Mod Id TBSHELF 01.03 2002/09/12 2002/10/11 09:37 11 11 0 KIL001 TBTOOL 01.12 2002/09/12 2004/11/26 19:54 51 28 0 KIL001 ------------------------------------------- [1] Name [2] VV.MM: Version . modification [3] Created: yyyy / MM / dd [4,5] Changed: yyyy / MM / dd HH:mm [6] Size: number of lines [7] Init: number of lines when first created [8] Mod: number of modified lines a last save [9] Id: User id for last update
file
- will be updated with Name, Type and Timestamp if parsed.entry
- zosDirectoryEntryprivate boolean parseSimpleEntry(FTPFile file, java.lang.String entry)
file
- entry
- private boolean parseUnixList(FTPFile file, java.lang.String entry)
file
- entry
- private boolean parseJeslevel1List(FTPFile file, java.lang.String entry)
[1] [2] [3] [4] [5] IBMUSER1 JOB01906 OUTPUT 3 Spool Files 012345678901234567890123456789012345678901234 1 2 3 4 ------------------------------------------- Group in regex [1] Job name [2] Job number [3] Job status (INPUT,ACTIVE,OUTPUT) [4] Number of sysout files [5] The string "Spool Files"
file
- will be updated with Name, Type and Timestamp if parsed.entry
- zosDirectoryEntryprivate boolean parseJeslevel2List(FTPFile file, java.lang.String entry)
[1] [2] [3] [4] [5] JOBNAME JOBID OWNER STATUS CLASS IBMUSER1 JOB01906 IBMUSER OUTPUT A RC=0000 3 spool files IBMUSER TSU01830 IBMUSER OUTPUT TSU ABEND=522 3 spool files 012345678901234567890123456789012345678901234 1 2 3 4 ------------------------------------------- Group in regex [1] Job name [2] Job number [3] Owner [4] Job status (INPUT,ACTIVE,OUTPUT) [5] Job Class [6] The rest
file
- will be updated with Name, Type and Timestamp if parsed.entry
- zosDirectoryEntrypublic java.util.List<java.lang.String> preParse(java.util.List<java.lang.String> orig)
preParse
in interface FTPFileEntryParser
preParse
in class FTPFileEntryParserImpl
orig
- Original list after it has been created from the server streamoriginal
unmodified.void setType(int type)
type
- The listing type.protected FTPClientConfig getDefaultConfiguration()
ConfigurableFTPFileEntryParserImpl
FTPClientConfig
parameter being specified.getDefaultConfiguration
in class ConfigurableFTPFileEntryParserImpl