You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by se...@mpsa.com on 2006/11/20 15:25:34 UTC
Réf. : Re: Réf. : Re: [NET] empty result with listFiles () method whereas I should get files
No, there are a few hidden files (.rhosts, .profile, ...) and various
non-hidden files or directories (like a few .sh, and so on).
Cordialement.
--
Serge SIMON
Pôle Composants Pyramide - DSIN/SIFA/GPRO/GPD1
email : serge.simon@mpsa.com
tél. : (03 81) 33 02 22
Rory Winston
<rwinston@eircom
.net> Pour
Jakarta Commons Users List
20/11/2006 15:22 <co...@jakarta.apache.org>,
Jakarta Commons Users List
<co...@jakarta.apache.org>
Veuillez cc
répondre à
Jakarta Commons Objet
Users List Re: Réf. : Re: [NET] empty result
<commons-user@ja with listFiles () method whereas I
karta.apache.org should get files
>
Are there just hidden files in your home directory (i.e. files beginning
with a dot '.')?
Rory
"Jakarta Commons Users List" <co...@jakarta.apache.org> wrote:
>
>
>
>
>
> Hi Rory,
>
> Thanks for your input, i didn't knew how to do that.
> I've just tried it, and obviously, I still don't know what happens.
>
> I'm unsure that the problem could be a parsing bug, because I tried to
> emulate a FTP session directly through a "telnet" command, and I got
> exactly the same output than the one received from a machine on which
> everything works fine.
>
> With the PrintCommandListener I get on a working AIX machine (<<<< =3D
> received, >>>> =3D sent) :
>
> <<<< 220 beaic1 FTP server (Version 4.1 Tue Jul 6 21:20:07 CDT 2004) re=
> ady.
> >>>> USER test
> <<<< 331 Password required for test.
> >>>> PASS test
> <<<< 230-Last unsuccessful login: Thu Nov 9 16:38:22 2006 on /dev/pts/=
> 7
> from beahba
> 230-Last login: Mon Nov 20 12:49:29 2006 on ftp from beahba
> 230 User test logged in.
> >>>> SYST
> <<<< 215 UNIX Type: L8 Version: BSD-44
> >>>> PASV
> <<<< 227 Entering Passive Mode (10,68,188,139,236,238)
> >>>> LIST
> <<<< 150 Opening data connection for /bin/ls.
> <<<< 226 Transfer complete.
>
> And printing what is returned by listFiles() outputs :
> > .glancerc_aix
> > .profile
> > .rhosts
> > tmp
> (...)
>
> (but i'm surprised not to see in the output of the ProtocolCommandListe=
> ner
> the result of the LIST command returned by the server - either in passi=
> ve
> or active mode, is there something else to do to track data outputs fro=
> m
> the server ?)
>
> And on the "not working" machine I get exatly the same log (but no data=
>
> resulting from listFiles() ):
>
> <<<< 220 ylai0029 FTP server (Version 4.1 Tue Jul 6 21:20:07 CDT 2004)
> ready.
> >>>> USER test
> <<<< 331 Password required for test.
> >>>> PASS test
> <<<< 230-Last login: lun 20 nov 12:49:29 NFT 2006 on ftp from beahba
> 230 User test logged in.
> >>>> SYST
> <<<< 215 UNIX Type: L8 Version: BSD-44
> >>>> PASV
> <<<< 227 Entering Passive Mode (10,68,212,66,210,94)
> >>>> LIST
> <<<< 150 Opening data connection for /bin/ls.
> <<<< 226 Transfer complete.
>
> (no data returned whereas I have .profile, tmp, and so on)
>
> --
> Serge.
>
>
>
> =
>
> Rory Winston =
>
> <rwinston@eircom =
>
> .net> P=
> our
> Jakarta Commons Users List =
>
> 20/11/2006 12:13 <commons-user@jakarta.apache.org=
> >,
> commons-user@jakarta.apache.org =
>
> =
> cc
> Veuillez =
>
> r=E9pondre =E0 =
> Objet
> Jakarta Commons Re: [NET] empty result with =
>
> Users List listFiles() method whereas I sho=
> uld
> <commons-user@ja get files =
>
> karta.apache.org =
>
> > =
>
> =
>
> =
>
> =
>
> =
>
>
>
>
>
> Hi Serge
>
> You could try to look at the commands being passed back and forth betwe=
> en
> 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 woul=
> d
> 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" <co...@jakarta.apache.org> 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 we=
> ll
> 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 wh=
> ere
> I
> > run my java program, or filezilla from my workstation), everything wo=
> rks
> > 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 =3D> same problem ;
> > - f.changeWorkingDirectory() before using listFiles() =3D> same probl=
> em ;
> > - study f.getReplyCode(); =3D> no usefull data in this case ;
> > - other account and/or other path =3D> same problem ;
> >
> > org.apache.commons.net.ftp.FTPClient f =3D new
> > org.apache.commons.net.ftp.FTPClient();
> > try {
> > f.connect(ftpHostname);
> > f.login(ftpLogin, ftpPassword);
> >
> > FTPFile[] files =3D f.listFiles();
> >
> > if ( files.length =3D=3D 0 ) {
> > System.out.println(" No results.");
> > } else {
> > for (int i =3D 0; i < files.length; i++) {
> > FTPFile f =3D files[i];
> > System.out.println(" > " + f.getName());
> > }
> > }
> >
> > } catch (SocketException e) {
> > e.printStackTrace();
> > } catch (IOException e) {
> > e.printStackTrace();
> > }
> >
> >
> >
> > ---------------------------------------------------------------------=
>
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org=
>
> >
> >
>
>
>
> -----------------------------------------------------------------
> 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: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
> =
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
-----------------------------------------------------------------
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: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org