MCPcopy Index your code
hub / github.com/apache/tomcat / clean

Method clean

java/org/apache/juli/FileHandler.java:511–525  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

509 }
510
511 private void clean() {
512 if (maxDays.intValue() <= 0 || Files.notExists(getDirectoryAsPath())) {
513 return;
514 }
515 DELETE_FILES_SERVICE.submit(() -> {
516 try (DirectoryStream<Path> files = streamFilesForDelete()) {
517 for (Path file : files) {
518 Files.delete(file);
519 }
520 } catch (IOException ioe) {
521 reportError("Unable to delete log files older than [" + maxDays + "] days", null,
522 ErrorManager.GENERIC_FAILURE);
523 }
524 });
525 }
526
527 private DirectoryStream<Path> streamFilesForDelete() throws IOException {
528 LocalDate maxDaysOffset = LocalDate.now().minusDays(maxDays.intValue());

Callers 6

FileHandlerMethod · 0.95
publishMethod · 0.95
shutdownMethod · 0.80
destroyMethod · 0.80
shutdownMethod · 0.80
destroyMethod · 0.80

Calls 4

getDirectoryAsPathMethod · 0.95
streamFilesForDeleteMethod · 0.95
deleteMethod · 0.65
submitMethod · 0.45

Tested by

no test coverage detected