< prev index next >
src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipDirectoryStream.java
Print this page
rev 53038 : 8215472: (zipfs) Cleanups in implementation classes of jdk.zipfs and tests
*** 1,7 ****
/*
! * Copyright (c) 2009, 2014, 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
--- 1,7 ----
/*
! * Copyright (c) 2009, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 23,45 ****
* questions.
*/
package jdk.nio.zipfs;
! import java.nio.file.DirectoryStream;
import java.nio.file.ClosedDirectoryStreamException;
import java.nio.file.NotDirectoryException;
import java.nio.file.Path;
import java.util.Iterator;
import java.util.NoSuchElementException;
- import java.io.IOException;
/**
*
! * @author Xueming Shen, Rajendra Gutupalli, Jaya Hangal
*/
-
class ZipDirectoryStream implements DirectoryStream<Path> {
private final ZipFileSystem zipfs;
private final ZipPath dir;
private final DirectoryStream.Filter<? super Path> filter;
--- 23,44 ----
* questions.
*/
package jdk.nio.zipfs;
! import java.io.IOException;
import java.nio.file.ClosedDirectoryStreamException;
+ import java.nio.file.DirectoryStream;
import java.nio.file.NotDirectoryException;
import java.nio.file.Path;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
*
! * @author Xueming Shen, Rajendra Gutupalli, Jaya Hangal
*/
class ZipDirectoryStream implements DirectoryStream<Path> {
private final ZipFileSystem zipfs;
private final ZipPath dir;
private final DirectoryStream.Filter<? super Path> filter;
*** 68,79 ****
try {
itr = zipfs.iteratorOf(dir, filter);
} catch (IOException e) {
throw new IllegalStateException(e);
}
return new Iterator<Path>() {
- private Path next;
@Override
public boolean hasNext() {
if (isClosed)
return false;
return itr.hasNext();
--- 67,78 ----
try {
itr = zipfs.iteratorOf(dir, filter);
} catch (IOException e) {
throw new IllegalStateException(e);
}
+
return new Iterator<Path>() {
@Override
public boolean hasNext() {
if (isClosed)
return false;
return itr.hasNext();
*** 95,101 ****
@Override
public synchronized void close() throws IOException {
isClosed = true;
}
-
}
--- 94,99 ----
< prev index next >