Android Directory Temp Create createTempDirectory()

Here you can find the source of createTempDirectory()

Description

create Temp Directory

Declaration

public static File createTempDirectory() throws IOException 

Method Source Code

//package com.java2s;

import java.io.File;

import java.io.IOException;

public class Main {
    public static File createTempDirectory() throws IOException {
        File dir = File.createTempFile("temp",
                Long.toString(System.nanoTime()));
        if (!(dir.delete()))
            throw new IOException("Could not delete temp file: "
                    + dir.getAbsolutePath());
        if (!(dir.mkdir()))
            throw new IOException("Could not create temp directory: "
                    + dir.getAbsolutePath());
        return (dir);
    }/*from   ww w.  j  a v a  2  s.  co  m*/
}

Related

  1. createTempDir()
  2. createTempDir(String dirname)
  3. createTempDir(final String prefix, final String suffix)
  4. mainTempDir()
  5. mktempdir()
  6. mktempdir(String filePrefix)
  7. setupTempDir()