mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
Enhance repository manager create api to perform actions after creation
This commit is contained in:
@@ -28,6 +28,7 @@ import sonia.scm.TypeManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* The central class for managing {@link Repository} objects.
|
||||
@@ -96,4 +97,11 @@ public interface RepositoryManager
|
||||
* @return all namespaces
|
||||
*/
|
||||
Collection<String> getAllNamespaces();
|
||||
|
||||
|
||||
default Repository create(Repository repository, Consumer<Repository> afterCreation) {
|
||||
Repository newRepository = create(repository);
|
||||
afterCreation.accept(newRepository);
|
||||
return newRepository;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user