public DirectoryStream<Path> newDirectoryStream(
      JimfsPath dir,
      DirectoryStream.Filter<? super Path> filter,
      Set<? super LinkOption> options,
      JimfsPath basePathForStream)
      throws IOException {
    Directory file = (Directory) lookUpWithLock(dir, options).requireDirectory(dir).file();
    FileSystemView view = new FileSystemView(store, file, basePathForStream);
    JimfsSecureDirectoryStream stream = new JimfsSecureDirectoryStream(view, filter, state());
    return store.supportsFeature(Feature.SECURE_DIRECTORY_STREAM)
        ? stream
        : new DowngradedDirectoryStream(stream);
  }
Creates a new directory stream for the directory located by the given path. The given {@code
basePathForStream} is that base path that the returned stream will use. This will be the same
as {@code dir} except for streams created relative to another secure stream.
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java