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

MVSFTPEntryParser.parseSimpleEntry - ArrayIndexOutOfBoundsException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1, 3.1
    • Fix Version/s: 3.2
    • Component/s: FTP
    • Labels:
      None
    • Environment:

      zOS

      Description

      Line 360 in MVSFTPEntryParser.parseSimpleEntry :

      String name = entry.split(" ")[0];

      gives an ArrayIndexOutOfBoundsException: 0

      It appears to be caused by a partitioned dataset whose members only contain names. No other details (creation date, file type etc).

      This is the method, if it helps:

      private boolean parseSimpleEntry(FTPFile file, String entry) {
          if (entry != null && entry.length() > 0) {
              file.setRawListing(entry);
              String name = entry.split(" ")[0];           // <--- error occurs here
              file.setName(name);
              file.setType(FTPFile.FILE_TYPE);
              return true;
          }
          return false;
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dmolony Denis Molony
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: