You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Bogdan Drozdowski (JIRA)" <ji...@apache.org> on 2011/02/07 17:59:57 UTC

[jira] Commented: (NET-342) Calling retrieveFileStream(fileName) before listFiles() causes ParserInitializationException

    [ https://issues.apache.org/jira/browse/NET-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991468#comment-12991468 ] 

Bogdan Drozdowski commented on NET-342:
---------------------------------------

This is the way it should be. You have not read the documentation and you haven't called client.completePendingCommand() after the file transfer. This didn't flush the server replies and messed up the server reply queue in the client.

> Calling retrieveFileStream(fileName) before listFiles() causes ParserInitializationException
> --------------------------------------------------------------------------------------------
>
>                 Key: NET-342
>                 URL: https://issues.apache.org/jira/browse/NET-342
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.0
>            Reporter: L K
>
> When calling FtpClient.retrieveFileStream(fileName) before FtpClient.listFiles() an org.apache.commons.net.ftp.parser.ParserInitializationException is thrown, giving the message: Unknown parser type: [last console output]
> Works:
> FTPFile[] ftpFiles = client.listFiles();
> InputStream is = client.retrieveFileStream("./test.txt");
> Works:
> client.pwd();
> FTPFile[] ftpFiles = client.listFiles();
> InputStream is = client.retrieveFileStream("./test.txt");
> Does not work:
> InputStream is = client.retrieveFileStream("./test.txt");
> client.pwd();
> FTPFile[] ftpFiles = client.listFiles();
> Output:
> org.apache.commons.net.ftp.parser.ParserInitializationException: Unknown parser type: "/" is the current directory

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