Android Folder Temp Create createTempFolder()

Here you can find the source of createTempFolder()

Description

create Temp Folder

Declaration

public static File createTempFolder() 

Method Source Code

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

import java.util.UUID;

public class Main {
    public static File createTempFolder() {
        File file = removeableFile(tempFolder(), UUID.randomUUID()
                .toString());/*w  w w .j a v a2 s.c  o  m*/
        file.mkdirs();
        return file;
    }

    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. createTempFolder()
  2. tempFolder()
  3. tempFolder()
  4. tempFolderName()