_logger.error("Could not read icon image: " + e1.getMessage());
}
// install wid and icon
repository.deleteAsset(profile.getRepositoryGlobalDir( uuid ) + "/" + widName + ".wid");
AssetBuilder widAssetBuilder = AssetBuilderFactory.getAssetBuilder(Asset.AssetType.Text);
widAssetBuilder.name(widName)
.location(profile.getRepositoryGlobalDir( uuid ))
.type("wid")
.content(workItemDefinitionContent);
repository.createAsset(widAssetBuilder.getAsset());
AssetBuilder iconAssetBuilder = AssetBuilderFactory.getAssetBuilder(Asset.AssetType.Byte);
String iconExtension = iconName.substring(iconName.lastIndexOf(".") + 1);
String iconFileName = iconName.substring(0, iconName.lastIndexOf("."));
repository.deleteAsset(profile.getRepositoryGlobalDir( uuid ) + "/" + iconFileName + "." + iconExtension);
iconAssetBuilder.name(iconFileName)
.location(profile.getRepositoryGlobalDir( uuid ))
.type(iconExtension)
.content(iconContent);
repository.createAsset(iconAssetBuilder.getAsset());
}
}
} else {
_logger.error("Invalid or empty service repository.");
resp.setCharacterEncoding("UTF-8");