|
You are quite correct. I remember thinking the same thing when this code was
submitted. However, it filled the needs of the original author and was better than nothing. None of the committers has access to an MVS system or any knowledge of it, as thanks for taking this into consideration.
I am more than willing to get this committed, so what is the process ? Must the copyright be assigned to Apache.org, and is so what are the paper work For the code ... To answer your question, I guess your choices are
1. Redo your code to use Regular Expressions and inherit from 2. If really don't want to use regex or it's impossible to write the parser As far as copyright goes, just start with what's in MVSFTPEntryParser.java. You However, it looks like you still have some work to do. Your code, I see, still Out of curiosity, would you mind also explaining for our benefit what these ZOS Finally, don't forget the JUnit tests. Please do not submit your patch until this is my current comments in my working version of MVSFTPEntryParser.java.
try to read it and let know if it is understandable. /*
/* Format of ZOS/MVS file list:
/*
Thanks very much for your comments on this OS. They help me to finally
understand what it is we are working with here. OK, here's what I think we'll do. I just noticed upthread your "I am not a java Let me have a whack at what you have done. Now that I understand the code, I henrik - one thing I notice in your code compared with the previous - in the
"FILELIST" mode, according to the guy who contributed the previous code, the "date" field is a "Date Last Accessed" and therefore not suitable for the timestamp field of FTPFile which assumes "Date Modified" semantics (for example the FTP tasks of Ant will use this for "newer" comparisons. Do you know if he was right? Created an attachment (id=18048)
Candidate replacement 3 - from Steve Cohen henrik - please have a look at this file. I believe it does basically the same I don't want to commit this until you have had a chance to test it in your As per earlier note, this FileList parser doesn't do anything with the date, Please send me your comments, and thanks for your contributions, without which Created an attachment (id=18049)
Candidate replacement 4 - from Steve Cohen Yet another attachment. I realized I could do some testing, and the previous henrik - please note that the way you were doing it, and the way my previous
thanks for spring cleaning of my code. I will soon try it, and let you know Exactly how is the MvsFilelist and MvsMemberlist classes choosen ? In the MvsMemberlistFTPEntryParser, you have catch (ParseException e) { return null; // this is a parsing failure too. }if the date information cannot parse, just set the field to null. There are a Further, in MvsFilelistFTPEntryParser, two comments. Second, in parseFTPEntry, don't be cheap with the if statements: it is a matter of style of course, but I doubt this extra if statement costs Lastly. The null issue (In reply to comment #12)
My comments are inline. > - steve, Yes, that is correct. > The problem is that there are at least one more list type beside the two Can we get parsers for those? Is that what you mean by "might come"? > The header that is removed in the preparse method is IMO the most reliable way You may be right. I thought about that and thought that this way was most > Why would the date SOMETIMES be blank. A system like that violates the usual > You're right. > This sounds like useful information. We could extend the composite pattern and > I am clueless as to where to put this information, but it could probably be done That is a possibility. Created an attachment (id=18148)
Candidate replacement 5 - from Henrik Sorensen Using the regex from the candidate repl 4, I have a version that now works, and I choose to use preParse to detect which type of list is comming. The problem with candiate 4, was the two REGEX is actually not mutually I had to add a new method to RegexFTPEntryParserImpl: catch (MalformedPatternException e) { throw new IllegalArgumentException ( "Unparseable regex supplied: " + regex); } return pattern!=null; and invoke the method from the constructor: Looking forward to your comments. (In reply to comment #13)
> (In reply to comment #12) > > My comments are inline. mine too > > Exactly how is the MvsFilelist and MvsMemberlist classes choosen ? > > By trial and error, aka the first parser that does not return null ? > > Yes, that is correct. but I cannot see how this can possible work. If for example the first entry on the file list is one of the unsupported types, the MvsFilelist parser returns null, and the MvsMemberlist is invoked?!? I have uploaded a candidate replacement 5, that uses preparse to detect which list is coming. > > > The problem is that there are at least one more list type beside the two > > mentioned, and more might come. > > Can we get parsers for those? well, the datasets are not relevant for FTP transfer, so I think not. >Is that what you mean by "might come"? > A system like that violates the usual > > The null issue In the ant FTP.java in package org.apache.tools.ant.taskdefs.optional.net, does Latest version of the MVS Ftp parser.
This version supports parsing of the following dataset organisations: PS: sequential files PO: partitioned files (single level direcory) PO-E:partitioned files (single level direcory) and the following record formats beginning with The files system is described in details within the source code. Further a parser for the JES subsystem level one has been added. (JES: Job entry Subsystem (scheduler)) With these two changes the JUNIT tests now completes.
I had to hack a bit in the FTPParseTestFramework.java, to make it work with multiple good samples testsets. The MVSFTPEntryParser now supports JES Interface Level 1 and 2.
The JUNIT test cases have been updated accordingly. Have fun |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MVSFTPEntryParser.java replacement
for review, note there is a lot of debug info, and further note, I am not
really a java programmer but are willing to learn, so just shoot on whatever
is moving ...