Check if a file store in which a particular file resides supports a single view - Java File Path IO

Java examples for File Path IO:File System

Description

Check if a file store in which a particular file resides supports a single view

Demo Code

import java.io.IOException;
import java.nio.file.FileStore;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

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

    Path path = Paths.get("C:/folder1/folder2/folder4", "test.txt");

    try {//from   ww  w.  ja  v  a2  s . c o m
      FileStore store = Files.getFileStore(path);
      boolean supported = store.supportsFileAttributeView("basic");
      System.out.println(store.name() + " ---" + supported);
    } catch (IOException e) {
      System.err.println(e);
    }

  }
}

Result


Related Tutorials