use of org.obiba.mica.network.event.NetworkDeletedEvent in project mica2 by obiba.
the class NetworkService method delete.
/**
* Delete a {@link Network}.
*
* @param id
* @throws NoSuchNetworkException
*/
public void delete(@NotNull String id) throws NoSuchNetworkException {
Network network = findById(id);
checkConstraints(network);
networkRepository.deleteWithReferences(network);
if (network.getLogo() != null)
fileStoreService.delete(network.getLogo().getId());
fileSystemService.delete(FileUtils.getEntityPath(network));
networkStateRepository.delete(id);
gitService.deleteGitRepository(network);
eventBus.post(new NetworkDeletedEvent(network));
}
Aggregations