Java Utililty Methods Random Temp File

List of utility methods to do Random Temp File

Description

The list of methods to do Random Temp File are organized into topic(s).

Method

FilegetRandomTempFile()
get Random Temp File
String tempName = UUID.randomUUID().toString().replaceAll("-", "");
File tempFile = new File(System.getProperty(JAVA_IO_TMP_DIR) + tempName + ".tmp");
if (!tempFile.createNewFile()) {
    throw new IOException("Can not create temp file :" + tempFile.getParent());
return tempFile;
FilegetRandomTemporaryFolder(String prefix, String suffix)
get Random Temporary Folder
return new File(System.getProperty("java.io.tmpdir"),
        Strings.nullToEmpty(prefix) + UUID.randomUUID().toString() + Strings.nullToEmpty(suffix));
FilegetRandomTmpFolder()
get Random Tmp Folder
String randomName = String.valueOf(System.currentTimeMillis());
return new File(getSystemTmpFolder(), randomName);