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

Method getFilesPosted

solr/core/src/java/org/apache/solr/cli/PostTool.java:485–498  ·  view source on GitHub ↗
(final OutputStream out, final String type, final String src)

Source from the content-addressed store, hash-verified

483 }
484
485 private int getFilesPosted(final OutputStream out, final String type, final String src)
486 throws IOException {
487 int filesPosted = 0;
488 Path srcFile = Path.of(src).toAbsolutePath();
489 boolean isValidPath = checkIsValidPath(srcFile);
490 if (isValidPath && Files.isDirectory(srcFile) && Files.isReadable(srcFile)) {
491 filesPosted += postDirectory(srcFile, out, type);
492 } else if (isValidPath && Files.isRegularFile(srcFile) && Files.isReadable(srcFile)) {
493 filesPosted += postFiles(List.of(srcFile), out, type);
494 } else {
495 filesPosted += handleGlob(src, out, type);
496 }
497 return filesPosted;
498 }
499
500 /**
501 * Posts a whole directory

Callers 1

postFilesMethod · 0.95

Calls 7

checkIsValidPathMethod · 0.95
postDirectoryMethod · 0.95
postFilesMethod · 0.95
handleGlobMethod · 0.95
isDirectoryMethod · 0.80
isReadableMethod · 0.80
ofMethod · 0.45

Tested by

no test coverage detected