use of com.enonic.xp.project.ModifyProjectIconParams in project xp by enonic.
the class ProjectServiceImpl method doModifyIcon.
private void doModifyIcon(final ModifyProjectIconParams params) {
final UpdateRepositoryParams updateParams = UpdateRepositoryParams.create().repositoryId(params.getName().getRepoId()).editor(editableRepository -> {
if (params.getIcon() != null) {
try {
editableRepository.binaryAttachments.add(createProjectIcon(params.getIcon(), params.getScaleWidth()));
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
final PropertySet projectData = editableRepository.data.getSet(ProjectConstants.PROJECT_DATA_SET_NAME);
setIconData(projectData, params.getIcon());
}).build();
repositoryService.updateRepository(updateParams);
}
Aggregations