Java Path Create nio createTmpDir(Path tmpDir, String prefix)

Here you can find the source of createTmpDir(Path tmpDir, String prefix)

Description

create Tmp Dir

License

Mozilla Public License

Declaration

public static Path createTmpDir(Path tmpDir, String prefix) throws IOException 

Method Source Code

//package com.java2s;
/**//from   ww  w . j  a v  a2s . c o  m
 * Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium)
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import java.io.IOException;

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

public class Main {
    public static Path createTmpDir(Path tmpDir, String prefix) throws IOException {
        if (tmpDir == null) {
            return Files.createTempDirectory(prefix);
        } else {
            return Files.createTempDirectory(tmpDir, prefix);
        }
    }
}

Related

  1. createTempDirectory(final String path, final String prefix)
  2. createTempDirectory(Path dir, String prefix)
  3. createTempFile(Path baseDir, String prefix, String suffix)
  4. createTempFilePath(final String stem, final String extension)
  5. createTempPath(String prefix, String suffix)
  6. createUniqueFilePath(final String directory, final String baseName, final String suffix)
  7. createUrlQuietly(Path path)
  8. createZipArchive(final Path sourceDir, final Path destFile)
  9. createZipFile(final File pathToArchive)