Java Temp Directory Create createTempDir(final String prefix)

Here you can find the source of createTempDir(final String prefix)

Description

create Temp Dir

License

Open Source License

Declaration

public static Path createTempDir(final String prefix) 

Method Source Code


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

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static Path createTempDir() {
        return createTempDir("");
    }//from   www .  ja  va 2s .c om

    public static Path createTempDir(final String prefix) {
        try {
            return Files.createTempDirectory(prefix);
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        return null;
    }
}

Related

  1. createTempDir()
  2. createTempDir()
  3. createTempDir(String prefix)
  4. createTempDir(String subdirectory)
  5. createTempDir(String suffix)
  6. createTempDirectory()