commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shane Witbeck (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NET-454) paths with spaces result in inaccurate file information
Date Sat, 17 Mar 2012 14:11:37 GMT

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

Shane Witbeck commented on NET-454:
-----------------------------------

Hi Sebb. The problematic names all have spaces. I've tried other combinations of file names
which work fine but spaces are the issue. I'm attaching more tests to illustrate. Below is
the output of the command-line:

{code}
ftp> ls 78/1295213/0/476312ca9c653ffc6cc8fb6e1649dae6/
227 Entering Passive Mode (10,6,125,100,127,91)
150 Accepted data connection
drwxr-xr-x    2 8517     8517           73 Mar 16 13:32 .
drwxr-xr-x    2 8517     8517           73 Mar 16 13:32 ..
-rw-r--r--    1 8517     8517        16939 Nov 30  2010 ModComp PO # 1054.pdf
-rw-r--r--    1 8517     8517        16939 Mar 16 13:28 ModComp PO.pdf
-rw-r--r--    1 8517     8517        16939 Mar 16 13:27 sdf sdf.pdf
226-Options: -a -l 
226 5 matches total
ftp> ls 78/1295213/0/476312ca9c653ffc6cc8fb6e1649dae6/ModComp PO #1054.pdf
usage: ls [remote-path [local-file]]
ftp> 
{code}

This all points to a specific issue with Pure-FTPd since I'm not able to reproduce locally
using the embedded Apache FTP server. 

Given all of this, what would be a good workaround for the remote host issue of not gracefully
handling spaces?
 
                
> paths with spaces result in inaccurate file information
> -------------------------------------------------------
>
>                 Key: NET-454
>                 URL: https://issues.apache.org/jira/browse/NET-454
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.0.1, 3.1
>         Environment: Mac OS X 10.7.3, FTP server is Pure-FTPd on Linux CentOS 5
>            Reporter: Shane Witbeck
>              Labels: ftp, path
>         Attachments: FTPClientTest.java
>
>
> Calling FTPClient.listFiles(String pathname) results in an inaccurate file list being
returned. The following test illustrates the issue:
> {code:java}
>     @Test
>     public void remoteListFilesFailure() throws Exception {
>         FTPClient client = new FTPClient();
>         client.connect(REMOTE_SERVER);
>         client.enterLocalPassiveMode();
>         client.login(REMOTE_USERNAME, REMOTE_PASSWORD);
>         client.setFileType(FTP.BINARY_FILE_TYPE);
>         int reply = client.getReplyCode();
>         if (!FTPReply.isPositiveCompletion(reply)) {
>             client.disconnect();
>             log.error("FTP server refused connection. reply=" + reply);
>         }
>         FTPFile[] rootFiles = client.listFiles("78/1295213/0/476312ca9c653ffc6cc8fb6e1649dae6/ModComp
PO # 1054.pdf");
>         Assert.assertEquals(1, rootFiles.length); // <-- fails with rootFiles.length
= 0
>     }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message