How to create a directory in Java? -
how create directory/folder?
once have tested system.getproperty("user.home");
i have create directory (directory name "new folder" ) if , if new folder not exist.
file thedir = new file("new folder"); // if directory not exist, create if (!thedir.exists()) { system.out.println("creating directory: " + thedir.getname()); boolean result = false; try{ thedir.mkdir(); result = true; } catch(securityexception se){ //handle } if(result) { system.out.println("dir created"); } }
wiki
Comments
Post a Comment