@Override
    protected synchronized Path computeNext() {
      checkOpen();

      try {
        if (fileNames == null) {
          fileNames = view.snapshotWorkingDirectoryEntries().iterator();
        }

        while (fileNames.hasNext()) {
          Name name = fileNames.next();
          Path path = view.getWorkingDirectoryPath().resolve(name);

          if (filter.accept(path)) {
            return path;
          }
        }

        return endOfData();
      } catch (IOException e) {
        throw new DirectoryIteratorException(e);
      }
    }
Secure directory stream implementation that uses a {@link FileSystemView} with the stream's
directory as its working directory.

@author Colin Decker
jimfs/src/main/java/com/google/common/jimfs/JimfsSecureDirectoryStream.java