Android File Create createTemporaryFile(String part, String ext)

Here you can find the source of createTemporaryFile(String part, String ext)

Description

create Temporary File

Declaration

public static File createTemporaryFile(String part, String ext)
            throws Exception 

Method Source Code

//package com.java2s;

import android.os.Environment;

import java.io.File;

public class Main {
    public static File createTemporaryFile(String part, String ext)
            throws Exception {
        File tempDir = Environment.getExternalStorageDirectory();
        tempDir = new File(tempDir.getAbsolutePath() + "/.temp/");
        if (!tempDir.exists()) {
            tempDir.mkdir();/*from   w  w  w .ja v  a 2  s.  c om*/
        }
        return File.createTempFile(part, ext, tempDir);
    }
}

Related

  1. getOutputMediaFile(Context context)
  2. makeFile(File file)
  3. makeFile(String destinctionFile)
  4. overwriteFile(File file)
  5. verifyCanCreateFile(final String path, final long length)