commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Cohen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (NET-386) Javadoc examples refer to code that has been removed.
Date Tue, 22 Mar 2011 15:12:06 GMT

     [ https://issues.apache.org/jira/browse/NET-386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Steve Cohen updated NET-386:
----------------------------

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


  was:
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.
    }


         Labels: javadoc  (was: )

How can I prevent jira from "formatting" the code snippets above?

> Javadoc examples refer to code that has been removed.
> -----------------------------------------------------
>
>                 Key: NET-386
>                 URL: https://issues.apache.org/jira/browse/NET-386
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.0, 2.2
>         Environment: any
>            Reporter: Steve Cohen
>            Assignee: Steve Cohen
>            Priority: Minor
>              Labels: javadoc
>
> 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.
>     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message