Created
February 20, 2014 13:56
-
-
Save nboubakr/9114097 to your computer and use it in GitHub Desktop.
This function allows you to create a directory on the user home directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void createDirectory(final String directoryName) { | |
final File homeDirectory = new File(System.getProperty("user.home")); | |
final File newDirectory = new File(homeDirectory, directoryName); | |
if(!newDirectory.exists()) { | |
boolean result = newDirectory.mkdir(); | |
if(result) { | |
System.out.println("The directory is created !"); | |
} | |
} else { | |
System.out.println("The directory already exist"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment