Skip to content

Add method to check if a path in zipfs is a symbolic link#2219

Merged
RealCLanger merged 5 commits intoSAP:sapmachinefrom
schmelter-sap:symlink-from-zipfs
Apr 28, 2026
Merged

Add method to check if a path in zipfs is a symbolic link#2219
RealCLanger merged 5 commits intoSAP:sapmachinefrom
schmelter-sap:symlink-from-zipfs

Conversation

@schmelter-sap
Copy link
Copy Markdown
Member

This adds a method to check if a given path from zipfs corresponds to a symbolic link.

fixes #2218

@SapMachine
Copy link
Copy Markdown
Member

Hello @schmelter-sap, this pull request fulfills all formal requirements.

@RealCLanger
Copy link
Copy Markdown
Member

restest this please

@RealCLanger
Copy link
Copy Markdown
Member

Do you really need this SharedSecrets stuff? I think for jdk.nio.zipfs it is fine to add public methods and call them since those are internal implementation classes.

You should only need to export the jdk.nio.zipfs package to jdk.sapext and then you can directly call any method you add.

Comment thread src/jdk.sapext/share/classes/com/sap/jdk/ext/util/ZipfsUtils.java Outdated
Comment thread src/jdk.sapext/share/classes/com/sap/jdk/ext/util/ZipfsUtils.java Outdated
@schmelter-sap
Copy link
Copy Markdown
Member Author

Regarding the shared secrets. A public method in an implementation class for which the user gets access too is still visible. Additionally I don't want to add a module dependency between the ext and the zipfs module, when it is not really needed.

@SapMachine
Copy link
Copy Markdown
Member

Hello @schmelter-sap, this pull request fulfills all formal requirements.

@RealCLanger
Copy link
Copy Markdown
Member

RealCLanger commented Apr 22, 2026

Regarding the shared secrets. A public method in an implementation class for which the user gets access too is still visible. Additionally I don't want to add a module dependency between the ext and the zipfs module, when it is not really needed.

Sure but having this public method visible is no problem. jdk.nio.zipfs.ZipFileSystem is no public API class so nobody would see it as API. Obviously somebody might go and try to reflectively look it up and use it. But that's possible with any internal class and developers should avoid that because of compatibility risk. Also, in later JDKs reflective access is disabled by default or should be soon - not exactly sure where Java is at at the moment... 😄

If you want to avoid a dependency between jdk.sapext and jdk.zipfs the way to go would also using services.

Copy link
Copy Markdown
Member

@RealCLanger RealCLanger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, a few last minor suggestions...

Comment thread src/java.base/share/classes/jdk/internal/access/JdkNioZipfsAccess.java Outdated
Comment thread src/jdk.sapext/share/classes/com/sap/jdk/ext/util/ZipfsUtils.java Outdated
Comment thread src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipPath.java Outdated
@SapMachine
Copy link
Copy Markdown
Member

Hello @schmelter-sap, this pull request fulfills all formal requirements.

Comment thread src/java.base/share/classes/jdk/internal/access/JdkNioZipfsAccess.java Outdated
@SapMachine
Copy link
Copy Markdown
Member

Hello @schmelter-sap, this pull request fulfills all formal requirements.

@SapMachine
Copy link
Copy Markdown
Member

Hello @schmelter-sap, this pull request fulfills all formal requirements.

@RealCLanger RealCLanger merged commit c70080d into SAP:sapmachine Apr 28, 2026
112 of 116 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add method to check if a path in zipfs is a symbolic link

4 participants