class RepositoryCopierImpl implements RepositoryCopier {

    public void fireNewBranchEvent(final Path targetRoot,
                                   final org.uberfire.java.nio.file.Path nioTargetRepositoryRoot,
                                   final org.uberfire.java.nio.file.Path originRepositoryRoot) {

        final Repository repository = repositoryService.getRepository(targetRoot);

        final Optional<Branch> branch = repository.getBranch(Paths.convert(nioTargetRepositoryRoot.getRoot()));

        final Optional<Branch> origBranch = repository.getBranch(Paths.convert(originRepositoryRoot.getRoot()));

        if (branch.isPresent()) {
            newBranchEventEvent.fire(new NewBranchEvent(repository,
                                                        branch.get().getName(),
                                                        origBranch.get().getName(),
                                                        sessionInfo.getIdentity().getIdentifier()));
        } else {
            throw new IllegalStateException("Could not find a branch that was just created. The Path used was " + nioTargetRepositoryRoot.getRoot());
        }
    }

    public  RepositoryCopierImpl();
    @Inject public  RepositoryCopierImpl(final @Named("ioStrategy") IOService ioService,
                                final Event<NewBranchEvent> newBranchEventEvent,
                                final ConfiguredRepositories configuredRepositories,
                                final RepositoryService repositoryService,
                                final SessionInfo sessionInfo);

}