src/java.base/share/classes/java/util/zip/ZipFile.java
changeset 52034 c83bc5def0d4
parent 50238 a9307f400f5a
child 52305 52a97e06a5e3
--- a/src/java.base/share/classes/java/util/zip/ZipFile.java	Fri Oct 05 20:03:14 2018 +0200
+++ b/src/java.base/share/classes/java/util/zip/ZipFile.java	Sun Oct 07 14:35:00 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
 import java.lang.ref.Cleaner.Cleanable;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.InvalidPathException;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.nio.file.Files;
 import java.util.ArrayDeque;
@@ -1218,8 +1219,13 @@
 
 
         static Source get(File file, boolean toDelete) throws IOException {
-            Key key = new Key(file,
-                              Files.readAttributes(file.toPath(), BasicFileAttributes.class));
+            final Key key;
+            try {
+                key = new Key(file,
+                        Files.readAttributes(file.toPath(), BasicFileAttributes.class));
+            } catch (InvalidPathException ipe) {
+                throw new IOException(ipe);
+            }
             Source src;
             synchronized (files) {
                 src = files.get(key);