Issue Details (XML | Word | Printable)

Key: NET-77
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Darrin Holst
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

[net] MVSFTPEntryParser setRawListing

Created: 18/Aug/05 11:21 PM   Updated: 19/Feb/08 10:33 PM
Return to search
Component/s: None
Affects Version/s: 1.4
Fix Version/s: 2.0

Time Tracking:
Not Specified

Environment:
Operating System: Windows 2000
Platform: PC

Bugzilla Id: 36249
Resolution Date: 19/Feb/08 10:33 PM


 Description  « Hide
The MVSFTPEntryParser is not setting the raw listing in the FTPFile that it
creates. The toString on FTPFile returns this value which causes a NPE when
trying to list files via ant.

Also it is creating an FTPFile for the header ("Volume Unit...") that it
receives from the host. This also causes a problem with the list function in ant
because it receives 2 entries when requesting a listing for 1 file. Ant
(probably wrongfully) is just taking the first entry in the array that it
receives back so you never get your file names.

The following code is how I got it to work...

private static final String HEADER = "Volume Unit Referred Ext Used Recfm
Lrecl BlkSz Dsorg Dsname";

...

public FTPFile parseFTPEntry(String entry)
{
FTPFile f = null;
if (matches(entry) && !entry.trim().equals(HEADER))

{ f = new FTPFile(); String dataSetName = group(2); f.setType(FTPFile.FILE_TYPE); f.setName(dataSetName); f.setRawListing(entry); return (f); }

return null;
}



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Rory Winston added a comment - 19/Feb/08 10:33 PM
This parser has been rewritten for 2.0