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)
| 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 |
no test coverage detected