in src/main/java/org/apache/sling/launchpad/base/impl/BootstrapInstaller.java [665:703]
private boolean isNewerSnapshot(final Bundle installedBundle, final Manifest manifest) {
String installedDate = installedBundle.getHeaders().get(
BND_LAST_MODIFIED_HEADER);
String toBeInstalledDate = manifest.getMainAttributes().getValue(
BND_LAST_MODIFIED_HEADER);
if (installedDate == null) {
logger.log(Logger.LOG_DEBUG, String.format(
"Currently installed bundle %s doesn't have a %s header",
installedBundle.getSymbolicName(), BND_LAST_MODIFIED_HEADER));
return true;
}
if (toBeInstalledDate == null) {
logger.log(Logger.LOG_DEBUG, String.format(
"Candidate bundle %s doesn't have a %s header",
installedBundle.getSymbolicName(), BND_LAST_MODIFIED_HEADER));
return true;
}
long installedTime, toBeInstalledTime = 0;
try {
installedTime = Long.valueOf(installedDate);
} catch (NumberFormatException e) {
logger.log(Logger.LOG_DEBUG, String.format(
"%s header of currently installed bundle %s isn't parseable.",
BND_LAST_MODIFIED_HEADER, installedBundle.getSymbolicName()));
return true;
}
try {
toBeInstalledTime = Long.valueOf(toBeInstalledDate);
} catch (NumberFormatException e) {
logger.log(Logger.LOG_DEBUG, String.format(
"%s header of candidate bundle %s isn't parseable.",
BND_LAST_MODIFIED_HEADER, installedBundle.getSymbolicName()));
return true;
}
return toBeInstalledTime > installedTime;
}