Java Temp File Create getTempFile(String extension)

Here you can find the source of getTempFile(String extension)

Description

get Temp File

License

BSD License

Declaration

public static File getTempFile(String extension) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2009-2012, University of Manchester
 * /*  w  w  w .  j  a va 2 s.com*/
 * Licensed under the New BSD License. 
 * Please see LICENSE file that is distributed with the source code
 ******************************************************************************/

import java.io.File;

import java.util.UUID;

public class Main {
    public static File getTempFile(String extension) {
        File tmpDir = new File(System.getProperty("java.io.tmpdir"));

        String uuid = UUID.randomUUID().toString();
        return new File(tmpDir, uuid + "." + extension);
    }
}

Related

  1. getTempFile(File parent, String fileName)
  2. getTempFile(final File stackFile)
  3. getTempFile(final String directory, final String suffix, boolean autodelete)
  4. getTempFile(final String name)
  5. getTempFile(String config)
  6. getTempFile(String fileId)
  7. getTempFile(String filePrefix, boolean deleteOnExit)
  8. getTempFile(String name)
  9. getTempFile(String tmpdir)