Example usage for java.io File separator

List of usage examples for java.io File separator

Introduction

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

Prototype

String separator

To view the source code for java.io File separator.

Click Source Link

Document

The system-dependent default name-separator character, represented as a string for convenience.

Usage

From source file:MainClass.java

public static void main(String[] a) {
    File myFile = new File("C:" + File.separator + "jdk1.5.0" + File.separator, "File.java");
    System.out.println(myFile.isFile());
}

From source file:MainClass.java

public static void main(String[] a) {
    File myFile = new File("C:" + File.separator + "jdk1.5.0" + File.separator, "File.java");
    System.out.println(myFile.exists());
}

From source file:MainClass.java

public static void main(String[] a) {
    File myFile = new File("C:" + File.separator + "jdk1.5.0" + File.separator, "File.java");
    System.out.println(myFile.getAbsoluteFile());
}

From source file:MainClass.java

public static void main(String[] a) {
    File myFile = new File("C:" + File.separator + "jdk1.5.0" + File.separator, "File.java");
    System.out.println(myFile.getParent());
    System.out.println(myFile);/*from   w w  w.  j ava  2  s  .  c o  m*/
}

From source file:MainClass.java

public static void main(String[] a) {
    File myFile = new File("C:" + File.separator + "jdk1.5.0" + File.separator, "File.java");
    System.out.println(myFile.getParentFile());
    System.out.println(myFile);/*from   w  w  w.  ja v a  2s  .  c  o  m*/
}

From source file:MainClass.java

public static void main(String[] a) {
    File myFile = new File("C:" + File.separator + "jdk1.5.0" + File.separator + "src" + File.separator + "java"
            + File.separator + "io", "File.java");
    System.out.println(myFile);/*from  w  w  w .j a va2  s .co m*/
}

From source file:MainClass.java

public static void main(String[] a) {
    File myFile = new File("C:" + File.separator + "jdk1.5.0" + File.separator, "File.java");
    System.out.println(myFile.getName());
    System.out.println(myFile.getPath());
}

From source file:MainClass.java

public static void main(String[] a) {
    File myFile = new File("C:" + File.separator);
    for (String s : myFile.list()) {
        System.out.println(s);/*ww w.  ja  v  a2s  . c  o m*/
    }
}

From source file:MainClass.java

public static void main(String[] a) {

    File myFile = new File("C:" + File.separator + "jdk1.5.0" + File.separator, "File.java");

    System.out.println(myFile.getParentFile());
    System.out.println(myFile);/*ww  w  .  j av  a2 s  . com*/
}

From source file:MainClass.java

public static void main(String args[]) {
    System.out.println(File.separator);

}