Extended Attributes Support (Linux/macOS)

Sebastian Stenzel sebastian.stenzel at gmail.com
Fri May 9 08:53:30 UTC 2025


For the sake of documenting the proposal, here is an issue: https://bugs.openjdk.org/browse/JDK-8356607

If anyone would sponsor this, I’d like to work on a PR.

> On 8. May 2025, at 21:08, Sebastian Stenzel <sebastian.stenzel at gmail.com> wrote:
> 
> Hi all,
> 
> A couple of releases ago I added some UserDefinedAttributeView support on macOS and did some cleanup and deduplications [1]. One thing has been bothering me since, though:
> 
> I’d like to add a new FileAttributeView named „xattr“ that basically is the same as UnixUserDefinedFileAttributeView [2] but without the „user.“ prefix, so it can be used to access extended attributes set by other applications.
> 
> This shouldn’t require many code additions, just some clever class hierarchy modifications. I.e. UnixUserDefinedFileAttributeView should extend ExtendedFileAttributeView. To achieve this, I propose to replace sun.nio.fs.AbstractUserDefinedFileAttributeView with an interface with default methods (now that the security manager is gone).
> 
> This isn’t public API, nevertheless I’d like to know if this would be an acceptable change or if you’d rather like me to use composition over inheritance.
> 
> Any thoughts?
> 
> Sebastian
> 
> 
> [1] https://github.com/openjdk/jdk/pulls?q=is%3Apr+author%3Aoverheadhunter+xattr+
> [2] https://github.com/openjdk/jdk/blob/jdk-24%2B36/src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/nio-dev/attachments/20250509/fe2a4b05/attachment.htm>


More information about the nio-dev mailing list