[esb-issues] [JBoss JIRA] Resolved: (JBESB-3293) FtpImpl getFileListFromRemoteDir() bad suffix handling, listing subdir contents

Tom Cunningham (JIRA) jira-events at lists.jboss.org
Wed Jun 30 15:39:46 EDT 2010


     [ https://jira.jboss.org/browse/JBESB-3293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom Cunningham resolved JBESB-3293.
-----------------------------------

    Resolution: Done


Made the fix so that we only list the files in the current directory (and not files in subdirectories) and added a test to verify this behavior.

> FtpImpl getFileListFromRemoteDir() bad suffix handling, listing subdir contents
> -------------------------------------------------------------------------------
>
>                 Key: JBESB-3293
>                 URL: https://jira.jboss.org/browse/JBESB-3293
>             Project: JBoss ESB
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Adapters
>    Affects Versions: 4.8
>            Reporter: Tom Eicher
>            Assignee: Tom Cunningham
>             Fix For: 4.9
>
>
> - RemoteFileSystem.getFileListFromRemoteDir(p_sSuffix) is meant to return the listing of the files of the current directory.
> - however, due to the "suffix enforcing" in FtpImpl, even calls like "getFileListFromRemoteDir(null)" and "getFileListFromRemoteDir("")" will be executed as getFileListFromRemoteDir("*"), making this a FTP "NLST *" command.
> - (and "getFileListFromRemoteDir(".")" will be "getFileListFromRemoteDir("*.")"...)
> - now, when your target directory contains only one entry, and that entry is a directory, the NLST will glob the "*" and return the listing of the subdir(!)
> - so, you will get unexpected results like "tmp/file1", "tmp/file2", when all you wanted was to receive the "tmp".
> - even when giving a suffix like "*.xml", this will return "tmp/file1.xml".
> - tested against Microsoft ftp server, but the behaviour is as expected, so will be identical with many ftp servers
> - fix: when no suffix given, call "listNames()", not "listNames("*")".
> - see also: FTPClient.listNames(String) docu, which says "The server may or may not expand glob expressions". For ftp servers not doing globbing, this means all downloads will fail.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the esb-issues mailing list