Tuesday, August 4, 2015

[Java] Create a File

Sample code to create a file.



public static boolean createFile(File file){
boolean created = false;
try {
created = file.createNewFile();
} catch (IOException e) {
LOG.error("Problem creating " + file.getAbsoluteFile() + " file.");
e.printStackTrace();
}
return created;


}

No comments:

Post a Comment