7
Public boolean isDirectory ()
Normal
Determines whether the specified path is a directory.
8
Public long length ()
Normal
Size of the returned File
9
Public String [] list ()
Normal
Lists all the contents of a specified directory, but lists the names
10
Public File [] listFiles ()
Normal
Lists All contents of a specified directory, a
folder B: Renaming considerations if the path name is the same, it is renamed. If the path name is different, it is renamed and clipped. C: Delete Note: Delete in Java does not go to the Recycle Bin. To delete a folder, note that the folder cannot contain files or Folders file class (the function of the file Class) A: Judge function public boolean isdirector
idea of optimization can be explained by the following diagram:First step: I first query the data table data in advance, and then put in the map.The second step: check whether the Excel database exists in databases, directly with the advance query placed in the map data to compare.The third step: when dealing with the primary foreign key relationship, the data in the map can be queried directly with advance query, and the data is not needed. to do the above optimization, if you need to handle 3
ioexception
Normal
Create a new file
Public Boolean exists ()
Normal
Determine whether a file exists
Public Boolean Delete ()
Normal
Delete an object
Public Boolean isdirectory ()
Normal
Determines whether the specified path is a directory.
Public long length ()
Normal
Size of the returned File
1. Store the data in the collection into a text file case:Requirement: To store string data in the ArrayList collection into a text file?(1) Analysis:Through the meaning of the topic, we can know some of the following things,A string is stored in the ArrayList collection.Traverse the ArrayList collection to get the data.It is then stored in a text file.The text file
NIO and IO in the java file system, and nioio in the java File System
Java introduced the java NIO mechanism since jdk1.4:
The notable features of NIO are channel, buffer, selector ), n
[Java iO] _ file class notes
Objectives of this chapter:
Measure the test taker's knowledge about the functions of the file class.You can use methods in the file class to operate files.
File class
In the entire
Blog from: http://blog.csdn.net/amosryan/article/details/6568783
Function directory: Convert input stream to byte stream read the file as a string to specify the encoding format to place the input stream into a list
Source:[Java] View Plain copy print? packageamosryan.utility.file; importjava.io.bufferedreader; importjava.io.bytearrayoutputstream; importjava.io.file;
The file IO in Java7 has changed a lot and has introduced many new classes specifically:Import Java.nio.file.DirectoryStream;Import Java.nio.file.FileSystem;Import Java.nio.file.FileSystems;Import Java.nio.file.Files;Import Java.n
The instance describes Java IO file replication, and the instance describes javaio
IO streams are mainly divided into two categories: byte streams and byte streams.
Note:
1. audio files, images, and videos (with a wide range) are throttled by words
2. if it involves only the text, the ghost stream is used.
Use byte str
The use of the file class in the JAVAI/O section of the Java---(note)In Java, I/O (input/output) is a tedious thing, because I do not see the obvious effect, but the input/output is a necessary part of all programs-using the input mechanism, allowing the program to read external data (including data from disk, CD and other storage devices), user input data, using
The file IO in Java7 has changed a lot and has introduced many new classes specifically:Import Java.nio.file.DirectoryStream;Import Java.nio.file.FileSystem;Import Java.nio.file.FileSystems;Import Java.nio.file.Files;Import Java.n
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.