Example usage for java.io File File

List of usage examples for java.io File File

Introduction

In this page you can find the example usage for java.io File File.

Prototype

public File(URI uri) 

Source Link

Document

Creates a new File instance by converting the given file: URI into an abstract pathname.

Usage

From source file:MainClass.java

public static void main(String[] a) {
    new File("c:\\a\\b\\c\\d\\e").mkdirs();
}

From source file:Main.java

public static void main(String[] a) {
    File file = new File("c:\\test\\test\\");
    file.mkdirs();
}

From source file:Main.java

public static void main(String[] args) {
    File file = new File("C:/demo.txt");
    System.out.println("Parent directory:" + file.getParent());
}

From source file:Main.java

public static void main(String[] args) {
    File file = new File("C:/Demo.txt");
    System.out.println(file.exists());
}

From source file:Main.java

public static void main(String[] args) {
    File f = new File("c:\\MyFolder");
    System.out.println(f);

}

From source file:Main.java

public static void main(String[] args) {
    File file = new File("C:/Demo.txt");

    System.out.println("File name is : " + file.getName());
}

From source file:MainClass.java

public static void main(String[] a) {
    File file = new File("c:\\text.txt");
    file.renameTo(new File("c:\\text.txt.bak"));
}

From source file:MainClass.java

public static void main(String[] a) {
    File file = new File("c:\\test\\");
    file.mkdir();
}

From source file:Main.java

public static void main(String[] args) {
    File file = new File("C:/Demo.txt");
    System.out.println(file.isHidden());
}

From source file:Main.java

public static void main(String[] args) {
    File file = new File("c:/a.htm");
    System.out.println(file.toPath());
}