Java Temp Directory Create makeTemporaryDirectory()

Here you can find the source of makeTemporaryDirectory()

Description

make Temporary Directory

License

Open Source License

Declaration

public static File makeTemporaryDirectory() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;
import java.io.IOException;

public class Main {
    public static File makeTemporaryDirectory(String prefix, String suffix) {
        try {/*from   w w w .  j  a  v  a 2  s.c o m*/
            File f = File.createTempFile(prefix, suffix);
            f.delete();
            f.mkdir();
            return f;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static File makeTemporaryDirectory() {
        return makeTemporaryDirectory("kiradb", ".index");
    }
}

Related

  1. makeTempDir(String prefix)
  2. makeTempDir(String prefix)
  3. makeTempDir(String prefix, String suffix)
  4. makeTempDirectory(String dirName, boolean deleteIfExists)
  5. makeTempDirectory(String prefix, String suffix)
  6. makeTemporaryDirectory(File baseDir, String prefix)
  7. makeTemporaryDirectory(String dir)