code: @Override
      public Iterator<Path> iterator() {
          if (closed) {
              throw new IllegalStateException("Directory Stream is closed");
          } else if (iteratorReturned) {
              throw new IllegalStateException("Iterator was already returned");
          }
  
          boolean finishedSuccessfully = true;
          try {
              // Translate ShrinkWrap API to NIO.2 API Path
              final Map<ArchivePath, Node> content = this.fs.getArchive().getContent();
              final Collection<Path> newPaths = new ArrayList<>(content.size());
              final Collection<ArchivePath> archivePaths = content.keySet();
              for (final ArchivePath path : archivePaths) {
                  final Path newPath = new ShrinkWrapPath(path, fs);
  
                  if (!newPath.getParent().equals(startingPath)) {
                      continue;
                  }
  
                  // If we have a filter, and it rejects this path
                  try {
                      if (filter != null && !(filter.accept(newPath))) {
                          // Move along
                          continue;
                      }
                  } catch (IOException ioe) {
                      throw new RuntimeException("Error encountered during filtering", ioe);
                  }
  
                  // Add the new Path; the filter either wasn't specified or didn't reject this Path
                  newPaths.add(newPath);
              }
  
              // Return
              return newPaths.iterator();
          } catch (Throwable t) {
              finishedSuccessfully = false;
              throw t;
          } finally {
              if (finishedSuccessfully) {
                  iteratorReturned = true;
              }
          }
      }
docs: {@inheritDoc}
  
  @see java.nio.file.DirectoryStream#iterator()