String websiteHostname = userPreferences.getAdditionalProperties().get("extensionswap.hostname");
if (StringUtils.isNullOrEmpty(websiteHostname)) {
websiteHostname = System.getProperty("extensionswap.hostname");
}
final ExtensionSwapClient extensionSwapClient;
if (StringUtils.isNullOrEmpty(websiteHostname)) {
logger.info("Using default ExtensionSwap website hostname");
extensionSwapClient = new ExtensionSwapClient(windowContext, userPreferences);
} else {
logger.info("Using custom ExtensionSwap website hostname: {}", websiteHostname);
extensionSwapClient = new ExtensionSwapClient(websiteHostname, windowContext, userPreferences);
}
ExtensionSwapInstallationHttpContainer container = new ExtensionSwapInstallationHttpContainer(extensionSwapClient,
userPreferences);
final Closeable closeableConnection = container.initialize();