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  .  j ava  2 s. co  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.





















Home »
  Java Tutorial »
    java.nio.file »




DirectoryStream.Filter
Files
FileStore
FileSystem
FileVisitor
Path
Paths
WatchService