MCPcopy Create free account
hub / github.com/apache/solr / postDirectory

Method postDirectory

solr/core/src/java/org/apache/solr/cli/PostTool.java:505–527  ·  view source on GitHub ↗

Posts a whole directory @return number of files posted total

(Path dir, OutputStream out, String type)

Source from the content-addressed store, hash-verified

503 * @return number of files posted total
504 */
505 private int postDirectory(Path dir, OutputStream out, String type) throws IOException {
506 if (Files.isHidden(dir) && !dir.getFileName().toString().equals(".")) {
507 return 0;
508 }
509 info(
510 "Indexing directory "
511 + dir
512 + " ("
513 + listFiles(dir, fileFilter).size()
514 + " files, depth="
515 + currentDepth
516 + ")");
517 int posted = 0;
518 posted += postFiles(listFiles(dir, fileFilter), out, type);
519 if (recursive > currentDepth) {
520 for (Path d : listFiles(dir, Files::isDirectory)) {
521 currentDepth++;
522 posted += postDirectory(d, out, type);
523 currentDepth--;
524 }
525 }
526 return posted;
527 }
528
529 /**
530 * Posts a collection of files identified by their paths

Callers 1

getFilesPostedMethod · 0.95

Calls 7

infoMethod · 0.95
listFilesMethod · 0.95
postFilesMethod · 0.95
getFileNameMethod · 0.80
toStringMethod · 0.65
sizeMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected