Java Path Create nio createTempFile(Path baseDir, String prefix, String suffix)

Here you can find the source of createTempFile(Path baseDir, String prefix, String suffix)

Description

create Temp File

License

Open Source License

Declaration

public static Path createTempFile(Path baseDir, String prefix, String suffix) throws IOException 

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 createTempFile(Path baseDir, String prefix, String suffix) throws IOException {
        Path tmp = Files.createTempFile(baseDir, prefix, suffix);
        tmp.toFile().deleteOnExit();//ww w. j a v  a 2 s .  c om
        return tmp;
    }

    public static Path createTempFile(String prefix, String suffix) throws IOException {
        Path tmp = Files.createTempFile(prefix, suffix);
        tmp.toFile().deleteOnExit();
        return tmp;
    }
}

Related

  1. createSymbolicLink(String linkPathString, String targetPathString)
  2. createSymlink(Path realFileLocation, Path softLinkLocation)
  3. createSymlink(String targetPathStr, File symlinkFile)
  4. createTempDirectory(final String path, final String prefix)
  5. createTempDirectory(Path dir, String prefix)
  6. createTempFilePath(final String stem, final String extension)
  7. createTempPath(String prefix, String suffix)
  8. createTmpDir(Path tmpDir, String prefix)
  9. createUniqueFilePath(final String directory, final String baseName, final String suffix)