public static File writeFileToTempDirectory ( final byte [ ] data , final String fileName ) { try { File file = createTempDirectory ( ) ; File out = new File ( file , fileName ) ; out . deleteOnExit ( ) ; file . deleteOnExit ( ) ; return writeDataToFile ( data , out ) ; } catch ( IOException e ) { JKExceptionUtil . handle ( e ) ; return null ; } }
Write file to temp directory .