In Java programs, you often need to deal with FTP, such as uploading and downloading files to the FTP server. This article briefly introduces how to use the ftpclient in Jakarta commons (in the Commons-Net Package) upload and download files.
1.
We may need to use FTP in the project to upload files, download, get server directory information and other related operations, we can use Apache ftpclient to carry out related operations, the following public methods related to share with you, each
This is because you need to obtain the size of the file to be downloaded in advance to implement multi-threaded FTP download of the same file,
First obtain the file list through listfiles () and then the file size. The Code is as follows:
Ftpfile []
Use the Apache FTP client to obtain the file list on the FTP Server FTP Response 421 resolved ed. Server closed connection
@ For & ever 2009-12-09
Use the Apache FTP client (Java open-source package commons-net-2.0) to obtain the file list on the
Reference: http://www.informit.com/guides/content.asp? G = Java & seqnum = 40
Although the Jakarta Apache organization has released a large number of open source projects, I am afraid Tomcat Servlet Engine is the most popular and widely used project.
The first steps to build the FTP service are as follows:1. Start the FTP service on the Win7: Click OK here, you may have to wait a while, after the completion of the system will sometimes prompt to restart2. Turn on the computer--"manage--" Here we
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.