Search in sources :

Example 1 with FileBasedRepositoryConfiguration

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;
}
Also used : GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) GitBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration) FileBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration) IOException(java.io.IOException)

Example 2 with FileBasedRepositoryConfiguration

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()));
}
Also used : GitBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration) FileBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration) GitBasedRepository(org.eclipse.winery.repository.backend.filebased.GitBasedRepository)

Example 3 with FileBasedRepositoryConfiguration

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;
}
Also used : GitBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration) FileBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration) IRepository(org.eclipse.winery.repository.backend.IRepository)

Example 4 with FileBasedRepositoryConfiguration

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;
}
Also used : FileBasedRepositoryConfiguration(org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration)

Aggregations

FileBasedRepositoryConfiguration (org.eclipse.winery.common.configuration.FileBasedRepositoryConfiguration)4 GitBasedRepositoryConfiguration (org.eclipse.winery.common.configuration.GitBasedRepositoryConfiguration)3 IOException (java.io.IOException)1 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)1 IRepository (org.eclipse.winery.repository.backend.IRepository)1 GitBasedRepository (org.eclipse.winery.repository.backend.filebased.GitBasedRepository)1