Listing File System Root Directories - Java File Path IO

Java examples for File Path IO:File System

Description

Listing File System Root Directories

Demo Code

import java.nio.file.FileSystems;
import java.nio.file.Path;

public class Main {
  public static void main(String[] args) {

    Iterable<Path> dirs = FileSystems.getDefault().getRootDirectories();
    for (Path name : dirs) {
      System.out.println(name);// w ww  . java2  s. c  o  m
    }

  }
}

Related Tutorials