src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipDirectoryStream.java
Print this page
@@ -39,36 +39,36 @@
*/
class ZipDirectoryStream implements DirectoryStream<Path> {
private final ZipFileSystem zipfs;
- private final byte[] path;
+ private final ZipPath dir;
private final DirectoryStream.Filter<? super Path> filter;
private volatile boolean isClosed;
private volatile Iterator<Path> itr;
- ZipDirectoryStream(ZipPath zipPath,
+ ZipDirectoryStream(ZipPath dir,
DirectoryStream.Filter<? super java.nio.file.Path> filter)
throws IOException
{
- this.zipfs = zipPath.getFileSystem();
- this.path = zipPath.getResolvedPath();
+ this.zipfs = dir.getFileSystem();
+ this.dir = dir;
this.filter = filter;
// sanity check
- if (!zipfs.isDirectory(path))
- throw new NotDirectoryException(zipPath.toString());
+ if (!zipfs.isDirectory(dir.getResolvedPath()))
+ throw new NotDirectoryException(dir.toString());
}
@Override
public synchronized Iterator<Path> iterator() {
if (isClosed)
throw new ClosedDirectoryStreamException();
if (itr != null)
throw new IllegalStateException("Iterator has already been returned");
try {
- itr = zipfs.iteratorOf(path, filter);
+ itr = zipfs.iteratorOf(dir, filter);
} catch (IOException e) {
throw new IllegalStateException(e);
}
return new Iterator<Path>() {
private Path next;
@@ -96,7 +96,6 @@
@Override
public synchronized void close() throws IOException {
isClosed = true;
}
-
}