Here you can find the source of createTempFile(String oriFileName)
public static File createTempFile(String oriFileName)
//package com.java2s; //License from project: Apache License import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Random; public class Main { public static File createTempFile(String oriFileName) { return new File(System.getProperty("java.io.tmpdir"), new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + "_" + new Random().nextInt(99999) + "_" + oriFileName); }// w w w. ja v a 2 s . c o m }