MCPcopy Create free account
hub / github.com/annmuor/jnode / completeMask

Method completeMask

jnode-core/src/jnode/ftn/FtnTools.java:722–739  ·  view source on GitHub ↗

Проверка соответствия маски :) @param route @param message @return

(Route route, FtnMessage message)

Source from the content-addressed store, hash-verified

720 * @return
721 */
722 public static boolean completeMask(Route route, FtnMessage message) {
723 boolean ok = true;
724 String[] regexp = new String[] { route.getFromAddr(),
725 route.getToAddr(), route.getFromName(), route.getToName(),
726 route.getSubject() };
727 String[] check = new String[] { message.getFromAddr().toString(),
728 message.getToAddr().toString(), message.getFromName(),
729 message.getToName(), message.getSubject() };
730 for (int i = 0; i < 5; i++) {
731 if (regexp[i] != null && !regexp[i].equals("*")) {
732 logger.l5("Checks " + check[i] + " via regexp " + regexp[i]);
733 if (check[i] == null || !check[i].matches(regexp[i])) {
734 ok = false;
735 }
736 }
737 }
738 return ok;
739 }
740
741 /**
742 * Проверка соответствия маски :)

Callers 3

getRoutingMethod · 0.95
getRoutingFallbackMethod · 0.95
processRewriteMethod · 0.95

Calls 13

l5Method · 0.80
getSubjectMethod · 0.65
getFromAddrMethod · 0.45
getToAddrMethod · 0.45
getFromNameMethod · 0.45
getToNameMethod · 0.45
toStringMethod · 0.45
equalsMethod · 0.45
getOrig_from_addrMethod · 0.45
getOrig_to_addrMethod · 0.45
getOrig_from_nameMethod · 0.45
getOrig_to_nameMethod · 0.45

Tested by

no test coverage detected