use of org.kie.workbench.common.stunner.core.backend.service.BackendFileSystemManager.AssetBuilder in project kie-wb-common by kiegroup.
the class WorkItemDefinitionRemoteDeployService method createIconAsset.
private static Optional<Asset> createIconAsset(final WorkItemDefinition item) {
final IconDefinition icon = item.getIconDefinition();
if (null != icon && null != icon.getUri()) {
final String path = parsePath(item.getUri());
final String iconUri = icon.getUri();
final Asset iconAsset;
try {
iconAsset = new AssetBuilder().setFileName(parseFileName(iconUri)).binaryFromURI(path + "/" + iconUri).build();
return Optional.of(iconAsset);
} catch (IOException e) {
LOG.error("Error reading work item definition asset from URL [" + item.getUri() + "]", e);
}
}
return Optional.empty();
}
Aggregations