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) 

Method Source Code


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

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

public class Main {
    public static void createFile(Path path) {
        try {/*from   w  w  w  .  j  av  a  2  s . c o  m*/
            Files.createFile(path);
        } catch (FileAlreadyExistsException e) {
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. createFile(File root, String path, String filename, String value)
  2. createFile(final Path file, final String line)
  3. createFile(Path filePath, byte[] content)
  4. createFile(Path p)
  5. createFile(Path path)
  6. createFile(Path path)
  7. createFile(Path path)
  8. createFile(String filePath, String content)
  9. createFile(String workspacePath)