One of the file programming is the file operation, is new, delete, copy, rename
New file with CreateNewFile () method, to handle IOException exception
New folder with Mkdirs () method
Delete a file and an empty folder directly with the Delete () method
The classes for copying and pasting files and folders have been given
A class that deletes a content folder has been given
Name of the file:
1. Determine if file exists
2. Create a renamed Filetwo
3.fileTwo Call exists () method confirms no duplicate name
4.file.renameto (Filetwo);
Note that file and Filetwo folders are guaranteed to be the same
Rename a folder, even if there is a file inside the folder can be renamed successfully, but delete the folder is not
-----------
The given class is written directly using the output stream FileOutputStream to write to the file and directly using the input stream FileInputStream to read the file
Of course, there are many subclasses of abstract reader and writer class, as well as their methods and methods of use.
The world of Java is profound, the moment also can not stop, time expensive like oil
Java File Programming Summary