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

Method obtainDateFromPath

java/org/apache/juli/FileHandler.java:548–560  ·  view source on GitHub ↗
(Path path)

Source from the content-addressed store, hash-verified

546 }
547
548 private String obtainDateFromPath(Path path) {
549 Path fileName = path.getFileName();
550 if (fileName == null) {
551 return null;
552 }
553 String date = fileName.toString();
554 if (pattern.matcher(date).matches()) {
555 date = date.substring(prefix.length());
556 return date.substring(0, date.length() - suffix.length());
557 } else {
558 return null;
559 }
560 }
561
562 /**
563 * Thread factory for creating log file cleanup threads.

Callers 1

streamFilesForDeleteMethod · 0.95

Calls 4

lengthMethod · 0.80
toStringMethod · 0.65
matchesMethod · 0.65
getFileNameMethod · 0.45

Tested by

no test coverage detected