Hi Serge You could try to look at the commands being passed back and forth between the FTPClient and the server by adding a PrintCommandListener instance to the client (see the FTP example classes for details), and see what the server is passing back. Its possible that there is a dormant bug in the directory entry parsing code being triggered here, in which case I would recommend you open an issue in JIRA and attach all of the relevant information you can (including the exact directory listing sent by the server).
Thanks Rory "Jakarta Commons Users List" <[email protected]> wrote: > > > > > > Hello, > > I have a strange behavior with commons-net, about FTP commands - with one > and only one AIX computer - and I can't find what the problem is. > > I'm using Jakarta commons-net 1.4.1 (same problem with a build from august > 2006). > > I use a FTPClient object invoking the listFiles() method. It works well on > any machine, excepted on one, where I get no files resulting from the > listFiles() method, whereas there are many files in my home directory. With > a direct ftp from another tool (ftp command line from the computer where I > run my java program, or filezilla from my workstation), everything works > fine and I get all the files in my home directory, so my credentials are > right and there is probably no network or firewall issue. > > Anyone has encountered this before ? Any idea about this ? > > The jar is launched with Java 1.4.2.02, the not-working computer runs AIX > 5.2 and I have another computer with exactly the same configuration (same > OS-level, same FTP server version) on which everythink works fine (as it > does on any other computer) > > I use the following (pretty simple) code. > I have tried a few things : > - active / passive mode => same problem ; > - f.changeWorkingDirectory() before using listFiles() => same problem ; > - study f.getReplyCode(); => no usefull data in this case ; > - other account and/or other path => same problem ; > > org.apache.commons.net.ftp.FTPClient f = new > org.apache.commons.net.ftp.FTPClient(); > try { > f.connect(ftpHostname); > f.login(ftpLogin, ftpPassword); > > FTPFile[] files = f.listFiles(); > > if ( files.length == 0 ) { > System.out.println(" No results."); > } else { > for (int i = 0; i < files.length; i++) { > FTPFile f = files[i]; > System.out.println(" > " + f.getName()); > } > } > > } catch (SocketException e) { > e.printStackTrace(); > } catch (IOException e) { > e.printStackTrace(); > } > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > ----------------------------------------------------------------- Find the home of your dreams with eircom net property Sign up for email alerts now http://www.eircom.net/propertyalerts --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
