Java Path Create nio createFile(Path path)

Here you can find the source of createFile(Path path)

Description

Creates a new and empty file.

License

Open Source License

Parameter

Parameter Description
path the path to the file to create.

Exception

Parameter Description
IOException if something goes wrong.

Declaration

public static void createFile(Path path) throws IOException 

Method Source Code


//package com.java2s;
import java.io.IOException;

import java.nio.file.*;

public class Main {
    /**//from w  w  w .  j  a  v a  2s  .c o  m
     * Creates a new and empty file.
     *
     * @param path the path to the file to create.
     * @throws IOException if something goes wrong.
     */
    public static void createFile(Path path) throws IOException {
        Files.createFile(path);
    }
}

Related

  1. createFile(final Path file, final String line)
  2. createFile(Path filePath, byte[] content)
  3. createFile(Path p)
  4. createFile(Path path)
  5. createFile(Path path)
  6. createFile(Path path)
  7. createFile(String filePath, String content)
  8. createFile(String workspacePath)
  9. createFileForReport(Path reportDir, String filePrefix, String fileSuffix)