UserDefinedAttributeView already facilitates extended attributes to store key/value pairs in file metadata. All keys are prefixed with "user." before being stored as xattr. Conversely, only xattr with this prefix are being read from a file.
While this allows associating KV pairs with files from within Java, it does not allow to write Java applications that need access to attributes using arbitrary keys such as:
* flags set by the OS
* labels, the user applied via the file manager
* metadata associated by third party software
Since access to extended attributes is already implemented, I propose to:
1. expose this API using a new interface ExtendedAttributeView and move existing code to access xattr to a corresponding implementation
2. refactor UserDefinedFileAttributeView to wrap an ExtendedAttributeView and apply the "user." prefix
While this allows associating KV pairs with files from within Java, it does not allow to write Java applications that need access to attributes using arbitrary keys such as:
* flags set by the OS
* labels, the user applied via the file manager
* metadata associated by third party software
Since access to extended attributes is already implemented, I propose to:
1. expose this API using a new interface ExtendedAttributeView and move existing code to access xattr to a corresponding implementation
2. refactor UserDefinedFileAttributeView to wrap an ExtendedAttributeView and apply the "user." prefix
- relates to
-
JDK-8336656 (fs) UserDefinedFileAttributeView attribute name semantics under-specified
-
- Open
-