Java Path.getFileSystem()

Syntax

Path.getFileSystem() has the following syntax.

FileSystem getFileSystem()

Example

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


/*  w w  w  .  j av a 2s.c o m*/
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.





















Home »
  Java Tutorial »
    java.nio.file »




DirectoryStream.Filter
Files
FileStore
FileSystem
FileVisitor
Path
Paths
WatchService