Details
-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
17
-
generic
-
generic
Description
A DESCRIPTION OF THE PROBLEM :
ZipPath.java:716 (as of 9d305b9c0625d73c752724569dbb7f6c8e80931c) throws UnsupportedOperationException if getFileAttributeView is called on a ZipPath for an unrecognized or disabled attribute view. However the JavaDocs say File.getFileAttributeView should return null when a view is unsupported.
This means you can't check for a ZipFS that has POSIX attributes enabled by simply querying the view without also being prepared to catch this exception, which is unexpected.
CUSTOMER SUBMITTED WORKAROUND :
Catch the exception and convert it to null.
ZipPath.java:716 (as of 9d305b9c0625d73c752724569dbb7f6c8e80931c) throws UnsupportedOperationException if getFileAttributeView is called on a ZipPath for an unrecognized or disabled attribute view. However the JavaDocs say File.getFileAttributeView should return null when a view is unsupported.
This means you can't check for a ZipFS that has POSIX attributes enabled by simply querying the view without also being prepared to catch this exception, which is unexpected.
CUSTOMER SUBMITTED WORKAROUND :
Catch the exception and convert it to null.
Attachments
Issue Links
- duplicates
-
JDK-8274607 (zipfs) Files.getFileAttributeView() throws UOE instead of returning null when view not supported
- Resolved
-
JDK-8273935 (zipfs) Files.getFileAttributeView() throws UOE instead of returning null when view not supported
- Closed