MCPcopy Create free account
hub / github.com/BaseXdb/basex / addDescendants

Method addDescendants

basex-core/src/main/java/org/basex/io/IOFile.java:436–445  ·  view source on GitHub ↗

Adds the relative paths of all descendant files to the specified list. @param io current file @param files file list @param filter file filter @param offset string length of root path

(final IOFile io, final StringList files,
      final FileFilter filter, final int offset)

Source from the content-addressed store, hash-verified

434 * @param offset string length of root path
435 */
436 private static void addDescendants(final IOFile io, final StringList files,
437 final FileFilter filter, final int offset) {
438 if(io.isDir()) {
439 for(final IOFile child : io.children(filter)) {
440 addDescendants(child, files, filter, offset);
441 }
442 } else if(filter == null || filter.accept(io.file)) {
443 files.add(io.path().substring(offset));
444 }
445 }
446
447 /**
448 * Checks if the specified string is a valid file name.

Callers 1

descendantsMethod · 0.95

Calls 6

acceptMethod · 0.65
addMethod · 0.65
isDirMethod · 0.45
childrenMethod · 0.45
substringMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected