This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git
The following commit(s) were added to refs/heads/master by this push:
new 33ce248 NET-682 MVSFTPEntryParser doesn't support Record Formats of U
33ce248 is described below
commit 33ce2489f72dc85a7093842bf5bb5843953c6556
Author: Sebb <[email protected]>
AuthorDate: Tue Jun 23 17:26:34 2020 +0100
NET-682 MVSFTPEntryParser doesn't support Record Formats of U
---
src/changes/changes.xml | 3 +++
.../org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java | 11 ++++++-----
.../apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java | 1 +
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 8d6e8d6..ac0eafe 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -162,6 +162,9 @@ This is mainly a bug-fix release. See further details below.
<action issue="NET-660" type="add" dev="sebb" due-to="Nagabhushan
S N">
Next and Previous IP Address in SubnetUtils.SubnetInfo
</action>
+ <action issue="NET-682" type="fix" dev="sebb" due-to="richard">
+ MVSFTPEntryParser doesn't support Record Formats of U
+ </action>
</release>
<release version="3.6" date="2017-02-15" description="
This is mainly a bug-fix release. See further details below.
diff --git
a/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
b/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
index 724770b..ce54404 100644
--- a/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
+++ b/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
@@ -59,6 +59,7 @@ public class MVSFTPEntryParser extends
ConfigurableFTPFileEntryParserImpl {
* Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname
* B10142 3390 2006/03/20 2 31 F 80 80 PS MDI.OKL.WORK
* </pre>
+ * @see
https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zconcepts/zconcepts_159.htm
*/
static final String FILE_LIST_REGEX = "\\S+\\s+" + // volume
// ignored
@@ -67,7 +68,7 @@ public class MVSFTPEntryParser extends
ConfigurableFTPFileEntryParserImpl {
"\\S+\\s+" + // extents -ignored
// If the values are too large, the fields may be merged (NET-639)
"(?:\\S+\\s+)?" + // used - ignored
- "[FV]\\S*\\s+" + // recfm - must start with F or V
+ "(?:F|FB|V|VB|U)\\s+" + // recfm - F[B], V[B], U
"\\S+\\s+" + // logical record length -ignored
"\\S+\\s+" + // block size - ignored
"(PS|PO|PO-E)\\s+" + // Dataset organisation. Many exist
@@ -198,8 +199,8 @@ public class MVSFTPEntryParser extends
ConfigurableFTPFileEntryParserImpl {
* for the FTP transfer.
*
* Any one beginning with either F or V can safely used by FTP transfer.
All
- * others should only be used with great care, so this version will just
- * ignore the other record formats. F means a fixed number of records per
+ * others should only be used with great care.
+ * F means a fixed number of records per
* allocated storage, and V means a variable number of records.
*
*
@@ -213,7 +214,7 @@ public class MVSFTPEntryParser extends
ConfigurableFTPFileEntryParserImpl {
* Implementation notes ====================
*
* Only datasets that have dsorg PS, PO or PO-E and have recfm beginning
- * with F or V, is fully parsed.
+ * with F or V or U, is fully parsed.
*
* The following fields in FTPFile is used: FTPFile.Rawlisting: Always set.
* FTPFile.Type: DIRECTORY_TYPE or FILE_TYPE or UNKNOWN FTPFile.Name: name
@@ -277,7 +278,7 @@ public class MVSFTPEntryParser extends
ConfigurableFTPFileEntryParserImpl {
/**
* Parse entries representing a dataset list. Only datasets with DSORG PS
or
- * PO or PO-E and with RECFM F* or V* will be parsed.
+ * PO or PO-E and with RECFM F[B], V[B], U will be parsed.
*
* Format of ZOS/MVS file list: 1 2 3 4 5 6 7 8 9 10 Volume Unit Referred
* Ext Used Recfm Lrecl BlkSz Dsorg Dsname B10142 3390 2006/03/20 2 31 F 80
diff --git
a/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
b/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
index be9fd4d..768bae8 100644
--- a/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParserTest.java
@@ -44,6 +44,7 @@ public class MVSFTPEntryParserTest extends
FTPParseTestFramework {
"FPFS41 3390 2004/06/23 1 1 FB 128 6144 PS
INCOMING.RPTBM056.D061704",
"FPFS25 3390 2004/06/23 1 1 FB 128 6144 PS
INCOMING.WTM204.D061704",
"PEX26F 3390 2017/07/03 115807 FB 29600 29600 PS
INCOMING.FIN.D170630.T160630",
+ "VVVVVV 3390 2020/04/18 1 60 U 32760 32760 PO NAME"
};
private static final String[] goodsamplesMemberList = {