/** * Matches these entries, note: no header: [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" * * * @param file * will be updated with Name, Type and Timestamp if parsed. * @param entry zosDirectoryEntry * @return true: entry was parsed, false: entry was not parsed. */ private boolean parseJeslevel1List(FTPFile file, String entry) { if (matches(entry)) { if (group(3).equalsIgnoreCase("OUTPUT")) { file.setRawListing(entry); String name = group(2); /* Job Number, used by GET */ file.setName(name); file.setType(FTPFile.FILE_TYPE); return true; } } return false; }
/** * Matches these entries, note: no header: [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 * * * @param file * will be updated with Name, Type and Timestamp if parsed. * @param entry zosDirectoryEntry * @return true: entry was parsed, false: entry was not parsed. */ private boolean parseJeslevel2List(FTPFile file, String entry) { if (matches(entry)) { if (group(4).equalsIgnoreCase("OUTPUT")) { file.setRawListing(entry); String name = group(2); /* Job Number, used by GET */ file.setName(name); file.setType(FTPFile.FILE_TYPE); return true; } } return false; }
/** * Parses a line of an MVS FTP server file listing and converts it into a * usable format in the form of an <code> FTPFile </code> instance. If the * file listing line doesn't describe a file, <code> null </code> is * returned, otherwise a <code> FTPFile </code> instance representing the * files in the directory is returned. * <p> * @param entry A line of text from the file listing * @return An FTPFile instance corresponding to the supplied entry */ public FTPFile parseFTPEntry(String entry) { FTPFile f = null; if (matches(entry)) { f = new FTPFile(); String dataSetName = group(2); f.setType(FTPFile.FILE_TYPE); f.setName(dataSetName); return (f); } return null; }