Java IO Tutorial - Java Path.getFileSystem()








Syntax

Path.getFileSystem() has the following syntax.

FileSystem getFileSystem()

Example

In the following code shows how to use Path.getFileSystem() method.

/*ww w  . j a v  a 2s .com*/
import java.nio.file.Path;
import java.nio.file.Paths;

public class Main {

  public static void main(String[] args) {
     Path path = Paths.get("C:/home/./music/users.txt");
     
     System.out.println(path.getFileSystem().getSeparator());

  }
}

The code above generates the following result.