This article source code is mainly for the application of Java to create file directory source code. If there is any deficiency, please ask the great God to correct me, I appreciate it!
Create the folder source code as follows:
1 /**2 * @function file operation: Create folder. If the folder does not exist, the folder is created and is not created if it exists. 3 * 4 * @authorAARON.FFP5 * @versionv1.0.0:autouiselenium main.java.aaron.java.tools Fileutils.java createpath, 2015-2-2 21:03:31 Exp $6 * 7 * @paramPath : Folder path8 * 9 * @returnBoolean returns True if the folder was successfully created;Ten */ One Public BooleanCreatepath (String path) { A BooleanFlag =false; - - Try{ theFile f =NewFile (path); - - if(!f.exists ()) { - f.mkdirs (); + } - +Flag =true; A}Catch(Exception IoE) { at This. Message =ioe.getmessage (); - This. Logger.error ( This. message); - } - - returnFlag; -}Create a file directory (cascade to create a folder)
At this point, Java Learning -010-Create folder source code successfully completed, I hope this article can give beginners Java you a reference.
Finally, very grateful to the pro-stop, I hope this article can be pro helpful. Warmly welcome the kiss to discuss together and progress together. Thank you so much! ^_^
Java Learning -010-Creating folder source code