public Vcs getVcs(final String type, Configuration configuration) { VcsSupportFactory vcsFactory = vcss.get(type); if (vcsFactory == null) { throw new PrideException("No support for VCS type \"" + type + "\""); } return new Vcs(type, vcsFactory.createVcsSupport(configuration)); }
public Vcs findSupportingVcs(File directory, Configuration configuration) { for (VcsSupportFactory factory : vcss.values()) { if (factory.canSupport(directory)) { return new Vcs(factory.getType(), factory.createVcsSupport(configuration)); } } throw new PrideException("No VCS support found for local repository in directory \"" + directory + "\""); }