(final OutputStream out, final String type, final String src)
| 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 |
no test coverage detected