use of com.enonic.xp.repository.DeleteBranchParams in project xp by enonic.
the class DeleteBranchHandler method doDeleteBranch.
private BranchMapper doDeleteBranch() {
final RepositoryId repositoryId = ContextAccessor.current().getRepositoryId();
if (isProtectedBranch(repositoryId, Branch.from(this.branchId))) {
throw new RepositoryExeption("No allowed to delete branch [" + this.branchId + "] in repository [" + repositoryId + "]");
}
final DeleteBranchParams deleteBranchParams = DeleteBranchParams.from(branchId);
final Branch deletedBranch = repositoryServiceSupplier.get().deleteBranch(deleteBranchParams);
return deletedBranch == null ? null : new BranchMapper(deletedBranch);
}
Aggregations