if (item != null) {
log.debug("Remote prefix on {} at path {} found!", mavenProxyRepository, path);
long prefixFileAgeInDays = (System.currentTimeMillis() - item.getModified()) / 86400000L;
Result unmarshalled = new TextFilePrefixSourceMarshaller(config).read(item);
if (!unmarshalled.supported()) {
return new StrategyResult("Remote disabled automatic routing", UNSUPPORTED_PREFIXSOURCE, false);
}
if (unmarshalled.entries().isEmpty()) {
return new StrategyResult("Remote publishes empty prefix file", UNSUPPORTED_PREFIXSOURCE, false);
}
final PrefixSource prefixSource = new FilePrefixSource(mavenProxyRepository, path, config);
if (prefixFileAgeInDays < 1) {
return new StrategyResult("Remote publishes prefix file (is less than a day old), using it.", prefixSource,
true);
}
else {
return new StrategyResult(
"Remote publishes prefix file (is " + prefixFileAgeInDays + " days old), using it.", prefixSource, true);
}
}
}
finally {