Java Temp File Create getTempFileName()

Here you can find the source of getTempFileName()

Description

Create temp file name based on current datetime

License

Open Source License

Return

String format as "yyyyMMddHHmmss"

Declaration

public static String getTempFileName() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**// w  ww  .ja va2s .  c o  m
     * Create temp file name based on current datetime
     * 
     * @return String format as "yyyyMMddHHmmss"
     */
    public static String getTempFileName() {
        DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
        return df.format(new Date());
    }
}

Related

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