Andreas Wagner created NET-725:
----------------------------------
Summary: Variable FILE_LIST_REGEX in class MVSFTPEntryParser must
be changed
Key: NET-725
URL: https://issues.apache.org/jira/browse/NET-725
Project: Commons Net
Issue Type: Bug
Components: FTP
Affects Versions: 3.9.0
Reporter: Andreas Wagner
Hello!
I have found two problems when connected to an MVS ftp server and using client
method "listFiles()".
1) Some files are not listed on ftp client side because not all possible MVS
dataset RECFM options are considered in class MVSFTPEntryParser.
2) Migrated MVS datasets are not listed on ftp client side
Detailed information for prolem 1 (not all possible RECFM options are
considered):
The final string variable FILE_LIST_REGEX in class MVSFTPEntryParser is missing
RECFM options. Therefore, valid dataset names are currently not correctly
recognized and therefore not processed (e.g. when using method "listFiles()").
The definition of the variable must be extended as follows.
Current definition:
static final string FILE_LIST_REGEX = "\\S+\\s+" + // volume - ignored
"\\S+\s+" + // unit - ignored
"\\S+\\s+" + // access date - ignored
"\\S+\s+" + // extents -ignored
// If the values are too large, the fields may be merged (NET-639)
"(?:\\S+\\s+)?" + // used - ignored
"(?: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 organization. Many exist
// but only support: PS, PO, PO-E
"(\\S+)\\s*"; // Dataset name (file name).
Future extended definition:
static final string FILE_LIST_REGEX = "\\S+\\s+" + // volume - ignored
"\\S+\s+" + // unit - ignored
"\\S+\\s+" + // access date - ignored
"\\S+\s+" + // extents -ignored
// If the values are too large, the fields may be merged (NET-639)
"(?:\\S+\\s+)?" + // used - ignored
"(?:F|FA|FB|FBA|V|VA|VB|VBA|VS|VBS|U)\\s+" + // recfm - F[A][B],
V[A][B][S], U
"\\S+\\s+" + // logical record length -ignored
"\\S+\s+" + // block size - ignored
"(PS|PO|PO-E)\\s+" + // Dataset organization. Many exist
// but only support: PS, PO, PO-E
"(\\S+)\\s*"; // Dataset name (file name).
Detailed information for prolem 2 (migrated MVS datasets are not listed):
Final variable FILE_LIST_REGEX doesn't consider migrated datasets. For example:
when dataset with name "HLQ.DATA.SET.NAME" is migrated on tape the mvs ftp
server return following text to the client:
Migrated 'HLQ.DATA.SET.NAME'
Since RECFM is not known by the ftp server for a migrated dataset the pattern
string stored in FILE_LIST_REGEX doesn't match in this case. But the migrated
datasets are of course valid datasets and therefore should be returned when
calling "listFiles()". At least the name of this (migrated) dataset should be
returned when calling "ftpFile.getName()".
With kind regards,
Andreas Wagner
--
This message was sent by Atlassian Jira
(v8.20.10#820010)