Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8356607

Add java.nio.file.attribute.ExtendedAttributeView (xattr)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None
    • generic
    • linux, os_x

      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

            bpb Brian Burkhalter
            sstenzel Sebastian Stenzel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: