Issue Details (XML | Word | Printable)

Key: NET-119
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Mario Ivankovits
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

[net] allow listing of hidden files

Created: 08/Nov/05 10:18 PM   Updated: 20/Sep/07 05:31 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File listHidden.patch 2005-11-09 01:52 AM Mario Ivankovits 7 kB
Environment:
Operating System: other
Platform: Other

Bugzilla Id: 37401
Resolution Date: 27/Aug/06 02:47 PM


 Description  « Hide
Some ftp server hide files from their users.
You can view them by issuing a "LIST -a" command.

I propose to add the method

FTPClient.setListHiddenFiles(boolean listHiddenFiles)

and if it is set to add a " -a" in to the list command in method
FTPClient.listFiles(FTPFileListParser parser, String pathname)

I'll prepare a patch if there is consens.

Thanks to Sylvain Perez for pointing this out.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mario Ivankovits added a comment - 09/Nov/05 01:52 AM
Created an attachment (id=16909)
add method FTPClient.setListHiddenFiles(boolean)

It also extends the example ftp.java and allows to
-l list files
-la list hidden files


Steve Cohen added a comment - 16/Nov/05 12:40 PM
I've taken a look at this and played with it. (I use a slightly different
implementation than your patch, working through FTPClientConfig.) But the root
functionality is the same as what you have done - add -a as the first argument.
However, I am not sure how well supported this is, as you point out. Some
servers, including one in our functional tests, include hidden files by default.
I am inclined to go with the idea anyway, with suitable disclaimers in the
docs, since nothing is hurt by this.

Mario Ivankovits added a comment - 16/Nov/05 06:28 PM
Sure, I thought about the FTPClientConfig too, but
this javadoc text
  • In particular this class was designed primarily to support configuration
  • of FTP servers which express file timestamps in formats and languages
  • other than those for the US locale

suggerates me its not the best place.
But I am fine with it, if ....
this doesnt mean we loose the automatic system detection when using this class,
eg. the constructor

public FTPClientConfig() { this(SYST_UNIX); }

looks like this is the case, isnt it?


Steve Cohen added a comment - 16/Nov/05 09:14 PM
You and your autodetection. I wish I never developed that mechanism

But I suppose you're right. Without reworking the whole FTPClientConfig
mechanism it would be impossible to allow this functionality to live there and
still be available in the autodetect scenario.

One idea would be to enable it in both places. Have a settable attribute in
FTPClient as well as FTPClientConfig. The getter in FTPClient could look in
both places.


Mario Ivankovits added a comment - 16/Nov/05 09:24 PM
(In reply to comment #4)
> You and your autodetection. I wish I never developed that mechanism
But it is sooo great stuff! I like it to see when computers are smart enough to
do such nifty work

Hmmm, it should be possible to archive it from VFS too, isnt it?

  • connect to the server
  • create a FTPClientConfig with getSystemName()
  • configure FTPClient with this FTPClientConfig(getSystemName())

as long as listFiles wasnt called nothing bad happend.
(bad=__entryParser is already initialised)

This is pretty much the same NET does now, just I wont bother you again with
this stuff


Mario Ivankovits added a comment - 16/Nov/05 09:27 PM
... and there is no need to have this hidden-file configuration in two places.

I'll try it after the 1.0 release of VFS, hopefully I havent overlooked something.


Steve Cohen added a comment - 17/Nov/05 10:52 AM
(In reply to comment #5)
> (In reply to comment #4)
> > You and your autodetection. I wish I never developed that mechanism
> But it is sooo great stuff! I like it to see when computers are smart enough to
> do such nifty work
>
> Hmmm, it should be possible to archive it from VFS too, isnt it?
>
> * connect to the server
> * create a FTPClientConfig with getSystemName()
> * configure FTPClient with this FTPClientConfig(getSystemName())
>

Yes, that would work, too.


Rory Winston added a comment - 27/Aug/06 02:47 PM
Applied patch to FTPClient