Example usage for java.nio.file FileSystems getDefault

List of usage examples for java.nio.file FileSystems getDefault

Introduction

In this page you can find the example usage for java.nio.file FileSystems getDefault.

Prototype

public static FileSystem getDefault() 

Source Link

Document

Returns the default FileSystem .

Usage

From source file:Main.java

public static void main(String[] args) throws Exception {
    Path path = FileSystems.getDefault().getPath("/home/docs/users.txt");
    System.out.println(Files.isExecutable(path));
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    Path newPath = FileSystems.getDefault().getPath("C:\\home\\docs\\");

    Files.delete(newPath);// ww  w  .  j  a va  2  s  .c  o m
    System.out.println("Directory deleted successfully!");
}

From source file:Test.java

public static void main(String[] args) throws Exception {

    Path newPath = FileSystems.getDefault().getPath("C:\\home\\docs\\");
    Path myDirectory = Files.createDirectory(newPath);
    System.out.println("Directory created successfully!");

}

From source file:Test.java

public static void main(String[] args) throws Exception {
    Path newFile = FileSystems.getDefault().getPath("C:\\home\\docs\\users.txt");
    Files.createFile(newFile);/*  www  .jav a2  s .co m*/
    System.out.println("File created successfully!");

    Files.delete(newFile);
    System.out.println("File deleted successfully!");

}

From source file:Main.java

public static void main(String[] args) throws IOException {
    FileSystem fileSystem = FileSystems.getDefault();
    System.out.println(fileSystem.getSeparator());
}

From source file:Main.java

public static void main(String[] args) throws IOException {
    FileSystem fileSystem = FileSystems.getDefault();
    System.out.println(fileSystem.isReadOnly());
}

From source file:Main.java

public static void main(String[] args) throws IOException {
    FileSystem fileSystem = FileSystems.getDefault();
    System.out.println(fileSystem.isOpen());
}

From source file:Test.java

public static void main(String[] args) throws Exception {
    Path originalDirectory = FileSystems.getDefault().getPath("C:/home/docs");
    Path newDirectory = FileSystems.getDefault().getPath("C:/home/tmp");

    Files.copy(originalDirectory, newDirectory);
    System.out.println("Directory copied successfully!");

}

From source file:Main.java

public static void main(String[] args) {

    Path path = FileSystems.getDefault().getPath("C:/tutorial/Java/JavaFX", "Demo.txt");

    boolean is_writable = Files.isWritable(path);
}

From source file:Main.java

public static void main(String[] args) {

    Path path = FileSystems.getDefault().getPath("C:/tutorial/Java/JavaFX", "Demo.txt");

    boolean is_readable = Files.isReadable(path);
}