Java Temp File Create getTempFileName()

Here you can find the source of getTempFileName()

Description

get Temp File Name

License

Open Source License

Declaration

public static String getTempFileName() 

Method Source Code

//package com.java2s;

import java.io.File;

import java.util.UUID;

public class Main {
    public static String getTempFileName() {
        String tmpDir = System.getProperty("java.io.tmpdir");
        if (tmpDir == null) {
            tmpDir = "/tmp";
        }//w ww. j  av a 2s .c  o m
        String uuid = UUID.randomUUID().toString();
        File f = new File(tmpDir, uuid);
        return f.getAbsolutePath();
    }
}

Related

  1. getTempFile(String name)
  2. getTempFile(String tmpdir)
  3. getTempFileDir()
  4. getTempFileFor(File file)
  5. getTempFileGivenName(File file)
  6. getTempFileName()
  7. getTempFileName(String base, String ext)
  8. getTempFileName(String fileExt)
  9. getTempFilePath(String name)