+ " with regex version comparison in IfVersion directive.");
return null;
}
}
OSGiVersionComparator comp = new OSGiVersionComparator();
boolean hasVersion = false;
if ("=".equals(operator)) {
if (regex) {
hasVersion = Pattern.matches(version, state.httpdVersion);
} else {
hasVersion = comp.compare(version, state.httpdVersion) == 0;
}
} else if ("~".equals(operator)) {
hasVersion = Pattern.matches(version, state.httpdVersion);
} else if (">".equals(operator)) {
hasVersion = comp.compare(state.httpdVersion, version) > 0;
} else if (">=".equals(operator)) {
hasVersion = comp.compare(state.httpdVersion, version) >= 0;
} else if ("<".equals(operator)) {
hasVersion = comp.compare(state.httpdVersion, version) < 0;
} else if ("<=".equals(operator)) {
hasVersion = comp.compare(state.httpdVersion, version) <= 0;
} else {
LOG.warn("Unknown operator " + operator + " in an IfVersion directive.");
return null;
}