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

Method handleGlob

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

This only handles file globs not full path globbing. @param globPathPattern glob pattern @param out outputStream to write results to @param type default content-type to use when posting (this may be overridden in auto mode) @return number of files posted @throws IOException if an I/O error occurs

(String globPathPattern, OutputStream out, String type)

Source from the content-addressed store, hash-verified

558 * @throws IOException if an I/O error occurs
559 */
560 int handleGlob(String globPathPattern, OutputStream out, String type) throws IOException {
561 int filesPosted = 0;
562 Path globPath = Path.of(globPathPattern);
563 Path parent = globPath.getParent();
564 if (parent == null) {
565 parent = Path.of(".");
566 }
567 String fileGlob = globPath.getFileName().toString();
568 GlobFilter ff = new GlobFilter(fileGlob, false);
569 Collection<Path> fileList = listFiles(parent, ff);
570 if (fileList.isEmpty()) {
571 warn("No files or directories matching " + globPath);
572 } else {
573 filesPosted = postFiles(fileList, out, type);
574 }
575 return filesPosted;
576 }
577
578 /**
579 * This method takes as input a list of start URL strings for crawling, converts the URL strings

Callers 1

getFilesPostedMethod · 0.95

Calls 8

listFilesMethod · 0.95
warnMethod · 0.95
postFilesMethod · 0.95
getFileNameMethod · 0.80
toStringMethod · 0.65
ofMethod · 0.45
getParentMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected