public final class FileAttributeViewCollection extends Object
FileAttributeViewMetadata
object.
Instances of this class can be used to implement several methods in FileStore
, FileSystem
and FileSystemProvider
.Modifier and Type | Method and Description |
---|---|
boolean |
containsView(Class<? extends FileAttributeView> type)
Returns whether or not this collection contains a specific view.
|
boolean |
containsView(String name)
Returns whether or not this collection contains a specific view.
|
FileAttributeViewMetadata |
getView(String name)
Returns a
FileAttributeViewMetadata object representing a specific view. |
String |
toString() |
Set<String> |
viewNames()
Returns the names of all contained views.
|
static FileAttributeViewCollection |
withViews(FileAttributeViewMetadata... views)
Creates a new collection of file attribute views.
|
public static FileAttributeViewCollection withViews(FileAttributeViewMetadata... views)
views
- The FileAttributeViewMetadata
objects representing the views in the created collection.NullPointerException
- If any of the given FileAttributeViewMetadata
objects is null.IllegalStateException
- If any of the FileAttributeViewMetadata
objects have duplicate view names.public boolean containsView(Class<? extends FileAttributeView> type)
type
- The type of file attribute view to check.true
if this collection contains the given view, or false
otherwise.FileStore.supportsFileAttributeView(Class)
public boolean containsView(String name)
name
- The name of the file attribute view to check.true
if this collection contains the given view, or false
otherwise.FileStore.supportsFileAttributeView(String)
public Set<String> viewNames()
FileSystem.supportedFileAttributeViews()
public FileAttributeViewMetadata getView(String name)
FileAttributeViewMetadata
object representing a specific view.name
- The name of the view to return a FileAttributeViewMetadata
object for.FileAttributeViewMetadata
object representing the given view.UnsupportedOperationException
- If no view with the given name is contained in this collection.containsView(String)
Copyright © 2016–2023. All rights reserved.