Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-77

[net] MVSFTPEntryParser setRawListing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4
    • 2.0
    • None
    • None
    • Operating System: Windows 2000
      Platform: PC

    • 36249

    Description

      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;
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            dholst@shazam.net Darrin Holst
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: