private static File getFax4jInternalTemporaryDirectoryImpl ( ) { File temporaryFile = null ; try { //create temporary file temporaryFile = File . createTempFile ( "temp_" , ".temp" ) ; } catch ( IOException exception ) { throw new FaxException ( "Unable to create temporary file." , exception ) ; } //get parent directory File temporaryDirectory = temporaryFile . getParentFile ( ) ; //delete file boolean deleted = temporaryFile . delete ( ) ; if ( ! deleted ) { temporaryFile . deleteOnExit ( ) ; } //read properties Properties properties = LibraryConfigurationLoader . readInternalConfiguration ( ) ; //get values String name = properties . getProperty ( "org.fax4j.product.name" ) ; String version = properties . getProperty ( "org.fax4j.product.version" ) ; //create sub directory File fax4jTemporaryDirectory = new File ( temporaryDirectory , name + "_" + version ) ; if ( ! fax4jTemporaryDirectory . exists ( ) ) { boolean created = fax4jTemporaryDirectory . mkdirs ( ) ; if ( ! created ) { throw new FaxException ( "Unable to create fax4j internal temporary directory: " + fax4jTemporaryDirectory ) ; } } return fax4jTemporaryDirectory ; }
This function returns the fax4j library internal temporary directory .