public static File createTmpDir ( String directoryName ) { File tmpDir = new File ( System . getProperty ( "java.io.tmpdir" ) ) ; File testDir = new File ( tmpDir , directoryName ) ; if ( ! testDir . mkdir ( ) ) { throw new ResourceUtilException ( "Can't create directory: " + testDir . getAbsolutePath ( ) ) ; } testDir . deleteOnExit ( ) ; return testDir ; }
This method will create a new directory in the system temp folder