Search in sources :

Example 21 with GitException

use of alien4cloud.exception.GitException in project alien4cloud by alien4cloud.

the class CsarFinderService method prepare.

/**
 * Search in the given path for folders that contains CloudServiceArchives and zip them so they.
 *
 * @param searchPath The path in which to search for archives.
 * @return a list of path that contains archives.
 */
public Set<Path> prepare(Path searchPath, Path zipPath) {
    ToscaFinderWalker toscaFinderWalker = new ToscaFinderWalker();
    toscaFinderWalker.zipRootPath = zipPath;
    toscaFinderWalker.rootPath = searchPath;
    try {
        Files.walkFileTree(searchPath, toscaFinderWalker);
    } catch (IOException e) {
        throw new GitException("Failed to browse git repository content in order to import archives.", e);
    }
    return toscaFinderWalker.toscaArchives;
}
Also used : GitException(alien4cloud.exception.GitException) IOException(java.io.IOException)

Aggregations

GitException (alien4cloud.exception.GitException)21 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)16 IOException (java.io.IOException)15 RevCommit (org.eclipse.jgit.revwalk.RevCommit)4 Path (java.nio.file.Path)3 GitConflictException (alien4cloud.exception.GitConflictException)2 BufferedWriter (java.io.BufferedWriter)1 File (java.io.File)1 URISyntaxException (java.net.URISyntaxException)1 NoHeadException (org.eclipse.jgit.api.errors.NoHeadException)1 RepositoryNotFoundException (org.eclipse.jgit.errors.RepositoryNotFoundException)1 Repository (org.eclipse.jgit.lib.Repository)1 StoredConfig (org.eclipse.jgit.lib.StoredConfig)1