Java IO Tutorial - Java FileSystem .supportedFileAttributeViews ()








Syntax

FileSystem.supportedFileAttributeViews() has the following syntax.

public abstract Set <String> supportedFileAttributeViews()

Example

In the following code shows how to use FileSystem.supportedFileAttributeViews() method.

//from w w  w . ja v  a2  s. c  o m
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
      //list all the supported views in the current file system
      FileSystem fs = FileSystems.getDefault();
      Set<String> views = fs.supportedFileAttributeViews();

      for (String view : views) {
          System.out.println(view);
      }
  
    }
}

The code above generates the following result.