Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.
no avatar
User

sachin4921

Posts

15

Joined

Mon Nov 05, 2012 6:10 pm

preventing hidden files from listing

by sachin4921 » Tue Apr 02, 2013 3:27 pm

could you please tell me a way that i could avoid all hidden files getting listed in dirdetails or dir methods
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: preventing hidden files from listing

by support2 » Tue Apr 02, 2013 10:08 pm

Probably the easiest way is to filter them out yourself after getting the listing.
no avatar
User

sachin4921

Posts

15

Joined

Mon Nov 05, 2012 6:10 pm

Any other way possible ?

by sachin4921 » Wed Apr 03, 2013 2:39 pm

Thanks for your reply but it seems your FTPFile object doesn't seem to be having such property that indicates that this file is hidden. As per your suggestion
i dont find a way other than checking name if starts with "."
Anyway
Is there any other way possible than listing all of them and manually discarding them ?
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Any other way possible ?

by support2 » Wed Apr 03, 2013 8:33 pm

No, it doesn't have a hidden property - you have to check.

There's one other way to do it - supply a callback to the dirDetails method to filter them out on the fly. But either way you have to do the check.
no avatar
User

sachin4921

Posts

15

Joined

Mon Nov 05, 2012 6:10 pm

k Got it

by sachin4921 » Wed Apr 03, 2013 8:57 pm

K... Thanks
no avatar
User

rafikielfriki

Posts

2

Joined

Fri Aug 23, 2013 4:58 am

by rafikielfriki » Fri Aug 23, 2013 6:07 am

Hi!

I'm trying to list all files and directories plus the hidden files.

I'm using the method directoryList() in the class FileTransferClient and I'm only able to see the directories and files of the current directory.

How can I see the hidden files? How can I include them in the list when I call the method directoryList?

I can see all the files including hidden files when I'm using Filezilla so the server can send them as part of the list.

I have also gave a look to the dirDetails("-a dirname") but this method is from the class FTPClient, not in FileTransferClient, and FTPClient would be deprecated.

How can I list all my files including hidden files with the class FileTransferClient?

Thanks in advance

By the way, I've seen the property showhiddenfiles for the .NET library (). Is there something similar for the java library?
no avatar
User

EDT Support

Posts

905

Joined

Mon Apr 26, 2004 3:03 pm

by EDT Support » Sat Aug 24, 2013 6:09 am

no avatar
User

rafikielfriki

Posts

2

Joined

Fri Aug 23, 2013 4:58 am

by rafikielfriki » Sat Aug 24, 2013 7:30 am

no avatar
User

MassimoPacini

Posts

1

Joined

Tue Sep 23, 2014 10:45 pm

Re:

by MassimoPacini » Tue Sep 23, 2014 10:52 pm

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Re:

by support2 » Wed Sep 24, 2014 12:54 am

I'm not sure what you mean in regard to directoryList() - please clarify.

There is already a recursive delete.
no avatar
User

vdeconinck

Posts

1

Joined

Tue Oct 14, 2014 7:10 pm

Re: preventing hidden files from listing

by vdeconinck » Tue Oct 14, 2014 7:21 pm


Who is online

Users browsing this forum: No registered users and 30 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron