Top Description Fields Constructors Methods
jdk.internal.jrtfs

pack-priv final Class JrtDirectoryStream

extends Object
implements DirectoryStream<Path>
Class Inheritance
All Implemented Interfaces
java.nio.file.DirectoryStream, java.lang.Iterable, java.io.Closeable, java.lang.AutoCloseable
Imports
java.nio.file.DirectoryStream, .ClosedDirectoryStreamException, .DirectoryIteratorException, .NotDirectoryException, .Path, java.util.Iterator, .Objects, .NoSuchElementException, java.io.IOException

DirectoryStream implementation for jrt file system implementations.

Implementation Note

This class needs to maintain JDK 8 source compatibility. It is used internally in the JDK to implement jimage/jrtfs access, but also compiled and delivered as part of the jrtfs.jar to support access to the jimage file provided by the shipped JDK by tools running on JDK 8.

Field Summary

Modifier and TypeField and Description
private final JrtPath
private final DirectoryStream.Filter<? super Path>
private boolean
private Iterator<Path>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public synchronized void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public synchronized Iterator<Path>
iterator()

Implements java.nio.file.DirectoryStream.iterator.

Returns the iterator associated with this DirectoryStream.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dirback to summary
private final JrtPath dir
filterback to summary
private final DirectoryStream.Filter<? super Path> filter
isClosedback to summary
private boolean isClosed
itrback to summary
private Iterator<Path> itr

Constructor Detail

JrtDirectoryStreamback to summary
pack-priv JrtDirectoryStream(JrtPath dir, DirectoryStream.Filter<? super Path> filter) throws IOException

Method Detail

closeback to summary
public synchronized void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
iteratorback to summary
public synchronized Iterator<Path> iterator()

Implements java.nio.file.DirectoryStream.iterator.

Doc from java.nio.file.DirectoryStream.iterator.

Returns the iterator associated with this DirectoryStream.

Returns:Iterator<Path>

the iterator associated with this DirectoryStream

Annotations
@Override