if (resourceLocalizer instanceof SmartResourceLocalizer) {
SmartResourceLocalizer smartResourceLocalizer = (SmartResourceLocalizer)resourceLocalizer;
smartResourceLocalizer.setStagingId(applicationId.toString());
if (!distribute) {
smartResourceLocalizer.resolve();
} else {
smartResourceLocalizer.distribute();
}
} else {
log.warn("Resource localizer is not instance of SmartResourceLocalizer, thus we're unable to resolve and distrute manually");