< prev index next >

src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipDirectoryStream.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2019, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -25,10 +25,11 @@
 
 package jdk.nio.zipfs;
 
 import java.io.IOException;
 import java.nio.file.ClosedDirectoryStreamException;
+import java.nio.file.DirectoryIteratorException;
 import java.nio.file.DirectoryStream;
 import java.nio.file.NotDirectoryException;
 import java.nio.file.Path;
 import java.util.Iterator;
 import java.util.NoSuchElementException;

@@ -65,11 +66,11 @@
             throw new IllegalStateException("Iterator has already been returned");
 
         try {
             itr = zipfs.iteratorOf(dir, filter);
         } catch (IOException e) {
-            throw new IllegalStateException(e);
+            throw new DirectoryIteratorException(e);
         }
 
         return new Iterator<Path>() {
             @Override
             public boolean hasNext() {
< prev index next >