Java Path Create nio createFile(Path path)

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

Description

create File

License

Open Source License

Declaration

public static void createFile(Path path) throws IOException 

Method Source Code


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

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

public class Main {
    public static void createFile(Path path) throws IOException {
        File file = path.toFile();
        if (file.exists()) {
            file.delete();//from w  w w  . j a  v a 2 s  . com
        }
        file.createNewFile();
    }
}

Related

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