Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More specific exception with traversing ZIP content #19

Closed
neroux opened this issue May 9, 2023 · 3 comments
Closed

More specific exception with traversing ZIP content #19

neroux opened this issue May 9, 2023 · 3 comments

Comments

@neroux
Copy link

neroux commented May 9, 2023

The IO exception thrown when a ZIP file contains files with traversing path names is a bit generic.

throw new IOException("Unzipping");

Maybe java.lang.IllegalStateException?

@igr
Copy link
Member

igr commented May 10, 2023

It would be better to have a custom IOException type, as this class throws all io exceptions... But I added a better message instead.

@igr igr closed this as completed in e8fba65 May 10, 2023
@neroux
Copy link
Author

neroux commented May 10, 2023

The updated message definitely clarifies it better. I'd probably still chose a different exception type, though, as that issue is not exactly IO related, but rather a security exception.

java.lang.SecurityException might be a good choice, if the documentation was not very specific on it

Thrown by the security manager to indicate a security violation

@igr
Copy link
Member

igr commented May 10, 2023

It's more illegal state of the zip, just the effect may be dangerous :) Still, lets keep IOexception, just to keep it the same as the rest of the io package.

I would replace them all with an unchecked version of IOException, but lets leave this version for the next major release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants