FileAttribute

  • FileAttribute objects store file attributes that can be set when creating files or directories using createFile or createDirectory methods.

  • This interface provides two methods: name() to retrieve the attribute name and value() to retrieve the attribute value.

  • PosixFilePermissions.asFileAttribute is a relevant method for creating FileAttribute instances.

public interface FileAttribute

An object that encapsulates the value of a file attribute that can be set atomically when creating a new file or directory by invoking the createFile or createDirectory methods.

Public Method Summary

abstract String
name()
Returns the attribute name.
abstract T
value()
Returns the attribute value.

Public Methods

public abstract String name ()

Returns the attribute name.

Returns
  • The attribute name

public abstract T value ()

Returns the attribute value.

Returns
  • The attribute value