dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Java
Expertise: Beginner
Apr 5, 1999

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Reading Files with FTP

Question:
I want to create an applcation that reads a file from a host on my LAN. The file must be read by FTP. How do I do this?

Answer:
If all you need to do is retrieve a single file by FTP, the easiest way to do this is to use the URL and URLConnection classes, referencing the file FTP-style URL (e.g., ftp://ftp.java-pro.com/). If you need to list directories and check file sizes, however, a dedicated FTP package might be more in line. The code for these alternatives is already listed in other questions, so I won't repeat it here. Take a look at the questions titled "Fetch contents of URL" to see how to use the URL class and "FTP with Java" to see how to use a dedicated FTP package. Both questions are in the Networking section of the Java section of the inquiry.com Web site.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date