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

Javadoc examples refer to code that has been removed.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.0, 2.2
    • 3.0
    • FTP
    • any

    Description

      The first example on the org.apache.commons.net.ftp.FTPFileEntryParser javadoc page refers to classes that have been removed since version 2.0:

      FTPClient f=FTPClient();
      f.connect(server);
      f.login(username, password);
      FTPFileList list = f.createFileList(directory, parser);
      FTPFileIterator iter = list.iterator();

      while (iter.hasNext())

      { FTPFile[] files = iter.getNext(25); // "page size" you want //do whatever you want with these files, display them, etc. //expensive FTPFile objects not created until needed. }

      FTPFileList and FTPFileIterator no longer exist.

      There is a good replacement for this example on the org.apache.commons.net.ftp.FTPListParseEngine javadoc page and that example should simply replace the one on the FTPFileEntryParser page.

      FTPClient f=FTPClient();
      f.connect(server);
      f.login(username, password);
      FTPListParseEngine engine = f.initiateListParsing(directory);

      while (engine.hasNext())

      { FTPFile[] files = engine.getNext(25); // "page size" you want //do whatever you want with these files, display them, etc. //expensive FTPFile objects not created until needed. }

      Attachments

        Issue Links

          Activity

            People

              scohen@apache.org Steve Cohen
              scohen@apache.org Steve Cohen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: