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 []
PackageCom.yyq;ImportJava.io.*;//File class/** used to encapsulate files or folders as objects * Convenient for manipulating file and folder property information * The files object can be passed as a parameter to a stream's constructor * Stream can
Original address: http://blog.sina.com.cn/s/blog_7a27a9bf0100s887.html
Sometimes you need to find a certain type of file in your program, such as the need to find all files that have a. java suffix name under the E:\data\file_selector_test directory.
Use the Retrievefilestream (filename) method to read a heap of file names generated by a particular rule, looping through file names.Use the Listfiles (FileName) method to determine whether the file exists before reading it.In the result loop, the
Introduction to the 1.File classThe file class is located in the Java.io package. It operates at the file hierarchy level, viewing the file, while the byte stream and character stream manipulate the data more clearly than the underlying.The learning
Includes the following classes and interfaces:
File class
FileFilter Interface
RandomAccessFile class
I. File class
Java. io. File is used to indicate the File directory). That is to say, the programmer can use the File class to operate the files
The user interface and operating system name the files and directories using the system-related pathname string. This class renders an abstract, system-independent view of the hierarchical path name. The abstract path name has two components:An
first, the file classget path or directory separatorpublic static void Main (string[] args) {//file class static member variable//system-related path delimiter String separator = file.pathseparator; SYSTEM.OUT.PRINTLN (separator);//is a semicolon,
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.