use of org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration in project winery by eclipse.
the class RepositoryFactory method getRepository.
/**
* Generates a new IRepository working on the specified path.
*/
public static IRepository getRepository(Path path) {
Objects.requireNonNull(path);
GitBasedRepositoryConfiguration config = new GitBasedRepositoryConfiguration(false, new FileBasedRepositoryConfiguration(path));
try {
reconfigure(config);
} catch (IOException | GitAPIException e) {
LOGGER.error("Error while reconfiguring the repository", e);
}
return repository;
}
use of org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration in project winery by eclipse.
the class AbstractGitResolver method createRepository.
@Override
public GitBasedRepository createRepository(File repositoryLocation) throws IOException, GitAPIException {
FileBasedRepositoryConfiguration compositeConfiguration = new FileBasedRepositoryConfiguration(Paths.get(repositoryLocation.toString()));
GitBasedRepositoryConfiguration configuration = new GitBasedRepositoryConfiguration(false, repositoryUrl, repositoryBranch, compositeConfiguration);
return new GitBasedRepository(configuration, RepositoryFactory.createXmlOrYamlRepository(compositeConfiguration, repositoryLocation.toPath()));
}
use of org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration in project winery by eclipse.
the class TenantRepository method initTenantRepository.
public IRepository initTenantRepository(String tenantName) throws GitAPIException, IOException {
FileBasedRepositoryConfiguration fileBasedConfig = new FileBasedRepositoryConfiguration(repositoryRoot.resolve(tenantName));
IRepository tenantRepo = this.createRepo(new GitBasedRepositoryConfiguration(false, fileBasedConfig));
repositories.put(tenantName, tenantRepo);
return tenantRepo;
}
use of org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration in project winery by eclipse.
the class RepositoryFactory method getRepository.
public static IRepository getRepository() {
if ((gitBasedRepositoryConfiguration == null) && (fileBasedRepositoryConfiguration == null)) {
// in case nothing is configured, use the file-based repository as fallback
LOGGER.debug("No repository configuration available. Using default configuration.");
reconfigure(new FileBasedRepositoryConfiguration());
}
return repository;
}
Aggregations