commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Eller (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (NET-639) Bug in MVSFTPEntryParser.preParse
Date Mon, 03 Jul 2017 14:02:00 GMT

    [ https://issues.apache.org/jira/browse/NET-639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16072470#comment-16072470
] 

Alexander Eller edited comment on NET-639 at 7/3/17 2:01 PM:
-------------------------------------------------------------

After further examination of the pattern, I changed the pattern FILE_LIST_REGEX as a first
fix. As - despite the long pattern - only the "recfm" (via pattern) and the "dataset organisation"
and "dataset name" (via group) are used, I changed the pattern part concerning the "used"
column to be optional (from "\\S+\\s+" to "\\S*\\s+") - now the above line  matches and the
line is part of the result.

First of all (breaking test first ;-)

in  MVSFTPEntryParserTest.java added at the end of goodsamplesDatasetList 

{code:java}
 "PEX26F 3390   2017/07/03  115807  FB   29600 29600  PS    INCOMING.FIN.D170630.T160630",

{code}

voila - test is breaking. Now make it green again: In MVSFTPEntryParser.java line 64ff

{code:java}
 static final String FILE_LIST_REGEX = "\\S+\\s+" + // volume
                                                                // ignored
            "\\S+\\s+" + // unit - ignored
            "\\S+\\s+" + // access date - ignored
            "\\S+\\s+" + // extents -ignored
            // ellera: "\\S+\\s+" replaced ...
            // change respects too large used values and therefor missing delimiter between
extents and used
            "\\S*\\s+" + // used - ignored 
            "[FV]\\S*\\s+" + // recfm - must start with F or V
            "\\S+\\s+" + // logical record length -ignored
            "\\S+\\s+" + // block size - ignored
            "(PS|PO|PO-E)\\s+" + // Dataset organisation. Many exist
            // but only support: PS, PO, PO-E
            "(\\S+)\\s*"; // Dataset Name (file name)
{code}

voila, tests are green - hope this helps ...


was (Author: baloo66):
After further examination of the pattern, I changed the pattern FILE_LIST_REGEX as a first
fix. As - despite the long pattern - only the "recfm" (via pattern) and the "dataset organisation"
and "dataset name" (via group) are used, I changed the pattern part concerning the "used"
column to be optional (from "\\S+\\s+" to "\\S*\\s+") - now the above line  matches and the
line is part of the result.

First of all (breaking test first ;-)

in  MVSFTPEntryParserTest.java added to goodsamplesDatasetList 

{code:java}
 "PEX26F 3390   2017/07/03  115807  FB   29600 29600  PS    INCOMING.FIN.D170630.T160630",

{code}

voila - test is breaking. Now make it green again: In MVSFTPEntryParser.java line 64ff

{code:java}
 static final String FILE_LIST_REGEX = "\\S+\\s+" + // volume
                                                                // ignored
            "\\S+\\s+" + // unit - ignored
            "\\S+\\s+" + // access date - ignored
            "\\S+\\s+" + // extents -ignored
            // ellera: "\\S+\\s+" replaced ...
            // change respects too large used values and therefor missing delimiter between
extents and used
            "\\S*\\s+" + // used - ignored 
            "[FV]\\S*\\s+" + // recfm - must start with F or V
            "\\S+\\s+" + // logical record length -ignored
            "\\S+\\s+" + // block size - ignored
            "(PS|PO|PO-E)\\s+" + // Dataset organisation. Many exist
            // but only support: PS, PO, PO-E
            "(\\S+)\\s*"; // Dataset Name (file name)
{code}

voila, tests are green - hope this helps ...

> Bug in MVSFTPEntryParser.preParse
> ---------------------------------
>
>                 Key: NET-639
>                 URL: https://issues.apache.org/jira/browse/NET-639
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.6
>         Environment: different clients running Windows 7, AIX, Ubuntu 16.04
> IBM FTP CS V2R1 as ftp host running z/OS 02.01.00
>            Reporter: Alexander Eller
>            Priority: Minor
>
> Some PS-files couldn't be retrieved from ftp host (during FTPClient.listFiles("xxx")).
After investigation we've noticed, that the file has an unusual large allocation info (reading

> {code:java}
> Volume Unit    Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname
>    :     :          :     :   :    :      :    :    :      :
> PEZ320 3390   2017/07/03  215807  FB   29600 29600  PS  'LBP.TX.FTP.LAZAGDOM.WORK.HILF'
>    :     :          :     :   :    :      :    :    :      :
> {code}
> so the values of ext and used column merged. As a result, the pattern FILE_LIST_REGEX
in MVSFTPEntryParser doesn't match -> the file is ignored.
> Quick Fix in Comments described ...



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message