Android File Temp Create aTempFile()

Here you can find the source of aTempFile()

Description

a Temp File

Declaration

public static File aTempFile() 

Method Source Code

//package com.java2s;
import java.io.File;

import java.util.UUID;

public class Main {
    public static File aTempFile() {
        return removeableFile(tempFolder(), UUID.randomUUID().toString());
    }/* ww  w .ja  v a 2  s  . c om*/

    private static File removeableFile(File folder, String fileName) {
        File file = new File(folder, fileName);
        file.deleteOnExit();
        return file;
    }

    private static File tempFolder() {
        return new File(tempFolderName());
    }

    private static String tempFolderName() {
        return System.getProperty("java.io.tmpdir");
    }
}

Related

  1. createTemp(File file)
  2. createTemp(String path)
  3. createTempFile()
  4. createTempFile(File baseDir, String fileName)