get contents of an ftp folder in java

E

Eqbal

I need to get contents of an ftp folder (it needs a username and
password too) and then treat the files in that folder like a regular
File object. Is it possible? Any pointers on how to do this?

Thanks.
 
T

Tor Iver Wilhelmsen

I need to get contents of an ftp folder (it needs a username and
password too) and then treat the files in that folder like a regular
File object. Is it possible? Any pointers on how to do this?

No, it's not possible as such, because the FTP protocol is vastly
different from the File object's functionality.

Look for an FTP library instead.
 
A

andreas

No, it's not possible as such, because the FTP protocol is vastly
different from the File object's functionality.

Look for an FTP library instead.

have a look at

http://www.nsftools.com/tips/FTPConnection.java

it is a complete ftp client. in the comments it says:

* this class can be freely distributed and
* modified as long as Bret Taylor is given credit in the source code
comments.

i hereby do give credit to Bret Taylor, since the client has been a great
help
for myself :)

- and yes, using this class you can connect to an ftp folder and treat the
files
like File objects.

andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top