
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.95 KB | hits: 11 | expires: Never
Creating new directories
private static File createNewTempDir() {
File baseDir = new File(System.getProperty("java.io.tmpdir"));
String baseNamePrefix = System.currentTimeMillis() + "_" + Math.random() + "-";
LOG.info(System.getProperty("java.io.tmpdir"));
File tempDir = new File(baseDir, baseNamePrefix + "0");
LOG.info(tempDir.getAbsolutePath());
tempDir.mkdirs();
if (tempDir.exists()) {
LOG.info("I would be happy!");
}
else {
LOG.info("No folder there");
}
return tempDir;
}
if (tempDir.exists()) {
LOG.info("I would be happy!");
}
else {
LOG.info("No folder there");
}
public static void main() {
File baseDir = new File(System.getProperty("java.io.tmpdir"));
File tempDir = new File(baseDir, "test0");
System.err.println(tempDir.getAbsolutePath());
tempDir.mkdir();
System.err.println("is it a dir? " + tempDir.isDirectory());
System.err.println("does it exist? " + tempDir.exists());
}