FileAttribute
Stay organized with collections
Save and categorize content based on your preferences.
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.
public
abstract
T
value
()
Returns the attribute value.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eFileAttribute\u003c/code\u003e objects store file attributes that can be set when creating files or directories using \u003ccode\u003ecreateFile\u003c/code\u003e or \u003ccode\u003ecreateDirectory\u003c/code\u003e methods.\u003c/p\u003e\n"],["\u003cp\u003eThis interface provides two methods: \u003ccode\u003ename()\u003c/code\u003e to retrieve the attribute name and \u003ccode\u003evalue()\u003c/code\u003e to retrieve the attribute value.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePosixFilePermissions.asFileAttribute\u003c/code\u003e is a relevant method for creating \u003ccode\u003eFileAttribute\u003c/code\u003e instances.\u003c/p\u003e\n"]]],["`FileAttribute` represents a file attribute's value that can be set atomically during file or directory creation using `Files.createFile` or `Files.createDirectory`. It contains two core actions: `name()`, which returns the attribute's name as a String, and `value()`, which returns the attribute's value, with the type determined dynamically. `PosixFilePermissions.asFileAttribute` is relevant.\n"],null,["public interface **FileAttribute** \nAn object that encapsulates the value of a file attribute that can be set\natomically when creating a new file or directory by invoking the [createFile](../../../../../reference/java/nio/file/Files.html#createFile(java.nio.file.Path,%20java.nio.file.attribute.FileAttribute\u003c?\u003e...)) or [createDirectory](../../../../../reference/java/nio/file/Files.html#createDirectory(java.nio.file.Path,%20java.nio.file.attribute.FileAttribute\u003c?\u003e...)) methods. \n\nSee Also\n\n- [PosixFilePermissions.asFileAttribute(Set)](../../../../../reference/java/nio/file/attribute/PosixFilePermissions.html#asFileAttribute(java.util.Set\u003cjava.nio.file.attribute.PosixFilePermission\u003e)) \n\nPublic Method Summary\n\n|-------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|\n| abstract [String](../../../../../reference/java/lang/String.html) | [name](../../../../../reference/java/nio/file/attribute/FileAttribute.html#name())() Returns the attribute name. |\n| abstract T | [value](../../../../../reference/java/nio/file/attribute/FileAttribute.html#value())() Returns the attribute value. |\n\nPublic Methods \n\npublic abstract [String](../../../../../reference/java/lang/String.html)\n**name**\n() \nReturns the attribute name. \n\nReturns\n\n- The attribute name \n\npublic abstract T\n**value**\n() \nReturns the attribute value. \n\nReturns\n\n- The attribute value"]]