Search in sources :

Example 21 with PATTERN_SITE

use of org.craftercms.studio.api.v1.constant.StudioConstants.PATTERN_SITE in project studio by craftercms.

the class RepositoryManagementServiceInternalImpl method resolveConflict.

@Override
public boolean resolveConflict(String siteId, String path, String resolution) throws CryptoException, ServiceLayerException {
    GitRepositoryHelper helper = GitRepositoryHelper.getHelper(studioConfiguration, securityService, userServiceInternal, encryptor, generalLockService, retryingRepositoryOperationFacade);
    Repository repo = helper.getRepository(siteId, SANDBOX);
    String gitLockKey = SITE_SANDBOX_REPOSITORY_GIT_LOCK.replaceAll(PATTERN_SITE, siteId);
    generalLockService.lock(gitLockKey);
    try (Git git = new Git(repo)) {
        ResetCommand resetCommand;
        CheckoutCommand checkoutCommand;
        switch(resolution.toLowerCase()) {
            case "ours":
                logger.debug("Resolve conflict using OURS strategy for site " + siteId + " and path " + path);
                logger.debug("Reset merge conflict in git index");
                resetCommand = git.reset().addPath(helper.getGitPath(path));
                retryingRepositoryOperationFacade.call(resetCommand);
                logger.debug("Checkout content from HEAD of studio repository");
                checkoutCommand = git.checkout().addPath(helper.getGitPath(path)).setStartPoint(Constants.HEAD);
                retryingRepositoryOperationFacade.call(checkoutCommand);
                break;
            case "theirs":
                logger.debug("Resolve conflict using THEIRS strategy for site " + siteId + " and path " + path);
                logger.debug("Reset merge conflict in git index");
                resetCommand = git.reset().addPath(helper.getGitPath(path));
                retryingRepositoryOperationFacade.call(resetCommand);
                logger.debug("Checkout content from merge HEAD of remote repository");
                List<ObjectId> mergeHeads = repo.readMergeHeads();
                ObjectId mergeCommitId = mergeHeads.get(0);
                checkoutCommand = git.checkout().addPath(helper.getGitPath(path)).setStartPoint(mergeCommitId.getName());
                retryingRepositoryOperationFacade.call(checkoutCommand);
                break;
            default:
                throw new ServiceLayerException("Unsupported resolution strategy for repository conflicts");
        }
        if (repo.getRepositoryState() == RepositoryState.MERGING_RESOLVED) {
            logger.debug("Merge resolved. Check if there are no uncommitted changes (repo is clean)");
            Status status = git.status().call();
            if (!status.hasUncommittedChanges()) {
                logger.debug("Repository is clean. Committing to complete merge");
                String userName = securityService.getCurrentUser();
                User user = userServiceInternal.getUserByIdOrUsername(-1, userName);
                PersonIdent personIdent = helper.getAuthorIdent(user);
                CommitCommand commitCommand = git.commit().setAllowEmpty(true).setMessage("Merge resolved. Repo is clean (no changes)").setAuthor(personIdent);
                retryingRepositoryOperationFacade.call(commitCommand);
            }
        }
    } catch (GitAPIException | IOException | UserNotFoundException | ServiceLayerException e) {
        logger.error("Error while resolving conflict for site " + siteId + " using " + resolution + " resolution " + "strategy", e);
        throw new ServiceLayerException("Error while resolving conflict for site " + siteId + " using " + resolution + " resolution " + "strategy", e);
    } finally {
        generalLockService.unlock(gitLockKey);
    }
    return true;
}
Also used : Status(org.eclipse.jgit.api.Status) RepositoryStatus(org.craftercms.studio.api.v2.dal.RepositoryStatus) UserNotFoundException(org.craftercms.studio.api.v1.exception.security.UserNotFoundException) CheckoutCommand(org.eclipse.jgit.api.CheckoutCommand) User(org.craftercms.studio.api.v2.dal.User) ObjectId(org.eclipse.jgit.lib.ObjectId) ServiceLayerException(org.craftercms.studio.api.v1.exception.ServiceLayerException) IOException(java.io.IOException) GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) RemoteRepository(org.craftercms.studio.api.v2.dal.RemoteRepository) Repository(org.eclipse.jgit.lib.Repository) ContentRepository(org.craftercms.studio.api.v1.repository.ContentRepository) Git(org.eclipse.jgit.api.Git) PersonIdent(org.eclipse.jgit.lib.PersonIdent) ResetCommand(org.eclipse.jgit.api.ResetCommand) CommitCommand(org.eclipse.jgit.api.CommitCommand) GitRepositoryHelper(org.craftercms.studio.api.v2.utils.GitRepositoryHelper)

Example 22 with PATTERN_SITE

use of org.craftercms.studio.api.v1.constant.StudioConstants.PATTERN_SITE in project studio by craftercms.

the class RepositoryManagementServiceInternalImpl method commitResolution.

@Override
public boolean commitResolution(String siteId, String commitMessage) throws CryptoException, ServiceLayerException {
    GitRepositoryHelper helper = GitRepositoryHelper.getHelper(studioConfiguration, securityService, userServiceInternal, encryptor, generalLockService, retryingRepositoryOperationFacade);
    Repository repo = helper.getRepository(siteId, SANDBOX);
    logger.debug("Commit resolution for merge conflict for site " + siteId);
    String gitLockKey = SITE_SANDBOX_REPOSITORY_GIT_LOCK.replaceAll(PATTERN_SITE, siteId);
    generalLockService.lock(gitLockKey);
    try (Git git = new Git(repo)) {
        Status status = git.status().call();
        logger.debug("Add all uncommitted changes/files");
        AddCommand addCommand = git.add();
        for (String uncommited : status.getUncommittedChanges()) {
            addCommand.addFilepattern(uncommited);
        }
        retryingRepositoryOperationFacade.call(addCommand);
        logger.debug("Commit changes");
        CommitCommand commitCommand = git.commit();
        String userName = securityService.getCurrentUser();
        User user = userServiceInternal.getUserByIdOrUsername(-1, userName);
        PersonIdent personIdent = helper.getAuthorIdent(user);
        String prologue = studioConfiguration.getProperty(REPO_COMMIT_MESSAGE_PROLOGUE);
        String postscript = studioConfiguration.getProperty(REPO_COMMIT_MESSAGE_POSTSCRIPT);
        StringBuilder sbMessage = new StringBuilder();
        if (StringUtils.isNotEmpty(prologue)) {
            sbMessage.append(prologue).append("\n\n");
        }
        sbMessage.append(commitMessage);
        if (StringUtils.isNotEmpty(postscript)) {
            sbMessage.append("\n\n").append(postscript);
        }
        commitCommand.setCommitter(personIdent).setAuthor(personIdent).setMessage(sbMessage.toString());
        retryingRepositoryOperationFacade.call(commitCommand);
        return true;
    } catch (GitAPIException | UserNotFoundException | ServiceLayerException e) {
        logger.error("Error while committing conflict resolution for site " + siteId, e);
        throw new ServiceLayerException("Error while committing conflict resolution for site " + siteId, e);
    } finally {
        generalLockService.unlock(gitLockKey);
    }
}
Also used : Status(org.eclipse.jgit.api.Status) RepositoryStatus(org.craftercms.studio.api.v2.dal.RepositoryStatus) UserNotFoundException(org.craftercms.studio.api.v1.exception.security.UserNotFoundException) User(org.craftercms.studio.api.v2.dal.User) ServiceLayerException(org.craftercms.studio.api.v1.exception.ServiceLayerException) GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) RemoteRepository(org.craftercms.studio.api.v2.dal.RemoteRepository) Repository(org.eclipse.jgit.lib.Repository) ContentRepository(org.craftercms.studio.api.v1.repository.ContentRepository) Git(org.eclipse.jgit.api.Git) PersonIdent(org.eclipse.jgit.lib.PersonIdent) CommitCommand(org.eclipse.jgit.api.CommitCommand) GitRepositoryHelper(org.craftercms.studio.api.v2.utils.GitRepositoryHelper) RemoteAddCommand(org.eclipse.jgit.api.RemoteAddCommand) AddCommand(org.eclipse.jgit.api.AddCommand)

Example 23 with PATTERN_SITE

use of org.craftercms.studio.api.v1.constant.StudioConstants.PATTERN_SITE in project studio by craftercms.

the class RepositoryManagementServiceInternalImpl method cancelFailedPull.

@Override
public boolean cancelFailedPull(String siteId) throws ServiceLayerException, CryptoException {
    logger.debug("To cancel failed pull, reset hard needs to be executed");
    GitRepositoryHelper helper = GitRepositoryHelper.getHelper(studioConfiguration, securityService, userServiceInternal, encryptor, generalLockService, retryingRepositoryOperationFacade);
    Repository repo = helper.getRepository(siteId, SANDBOX);
    String gitLockKey = SITE_SANDBOX_REPOSITORY_GIT_LOCK.replaceAll(PATTERN_SITE, siteId);
    generalLockService.lock(gitLockKey);
    try (Git git = new Git(repo)) {
        ResetCommand resetCommand = git.reset().setMode(ResetCommand.ResetType.HARD);
        retryingRepositoryOperationFacade.call(resetCommand);
    } catch (GitAPIException e) {
        logger.error("Error while canceling failed pull for site " + siteId, e);
        throw new ServiceLayerException("Reset hard failed for site " + siteId, e);
    } finally {
        generalLockService.unlock(gitLockKey);
    }
    return true;
}
Also used : GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) RemoteRepository(org.craftercms.studio.api.v2.dal.RemoteRepository) Repository(org.eclipse.jgit.lib.Repository) ContentRepository(org.craftercms.studio.api.v1.repository.ContentRepository) Git(org.eclipse.jgit.api.Git) ResetCommand(org.eclipse.jgit.api.ResetCommand) ServiceLayerException(org.craftercms.studio.api.v1.exception.ServiceLayerException) GitRepositoryHelper(org.craftercms.studio.api.v2.utils.GitRepositoryHelper)

Example 24 with PATTERN_SITE

use of org.craftercms.studio.api.v1.constant.StudioConstants.PATTERN_SITE in project studio by craftercms.

the class RepositoryManagementServiceInternalImpl method addRemote.

@Override
public boolean addRemote(String siteId, RemoteRepository remoteRepository) throws ServiceLayerException, InvalidRemoteUrlException {
    boolean isValid = false;
    String gitLockKey = SITE_SANDBOX_REPOSITORY_GIT_LOCK.replaceAll(PATTERN_SITE, siteId);
    generalLockService.lock(gitLockKey);
    try {
        logger.debug("Add remote " + remoteRepository.getRemoteName() + " to the sandbox repo for the site " + siteId);
        GitRepositoryHelper helper = GitRepositoryHelper.getHelper(studioConfiguration, securityService, userServiceInternal, encryptor, generalLockService, retryingRepositoryOperationFacade);
        Repository repo = helper.getRepository(siteId, SANDBOX);
        try (Git git = new Git(repo)) {
            Config storedConfig = repo.getConfig();
            Set<String> remotes = storedConfig.getSubsections("remote");
            if (remotes.contains(remoteRepository.getRemoteName())) {
                throw new RemoteAlreadyExistsException(remoteRepository.getRemoteName());
            }
            RemoteAddCommand remoteAddCommand = git.remoteAdd();
            remoteAddCommand.setName(remoteRepository.getRemoteName());
            remoteAddCommand.setUri(new URIish(remoteRepository.getRemoteUrl()));
            retryingRepositoryOperationFacade.call(remoteAddCommand);
            try {
                isValid = helper.isRemoteValid(git, remoteRepository.getRemoteName(), remoteRepository.getAuthenticationType(), remoteRepository.getRemoteUsername(), remoteRepository.getRemotePassword(), remoteRepository.getRemoteToken(), remoteRepository.getRemotePrivateKey());
            } finally {
                if (!isValid) {
                    RemoteRemoveCommand remoteRemoveCommand = git.remoteRemove();
                    remoteRemoveCommand.setRemoteName(remoteRepository.getRemoteName());
                    retryingRepositoryOperationFacade.call(remoteRemoveCommand);
                    List<Ref> resultRemoteBranches = git.branchList().setListMode(ListBranchCommand.ListMode.REMOTE).call();
                    List<String> branchesToDelete = new ArrayList<String>();
                    for (Ref remoteBranchRef : resultRemoteBranches) {
                        if (remoteBranchRef.getName().startsWith(Constants.R_REMOTES + remoteRepository.getRemoteName())) {
                            branchesToDelete.add(remoteBranchRef.getName());
                        }
                    }
                    if (CollectionUtils.isNotEmpty(branchesToDelete)) {
                        DeleteBranchCommand delBranch = git.branchDelete();
                        String[] array = new String[branchesToDelete.size()];
                        delBranch.setBranchNames(branchesToDelete.toArray(array));
                        delBranch.setForce(true);
                        retryingRepositoryOperationFacade.call(delBranch);
                    }
                }
            }
        } catch (URISyntaxException e) {
            logger.error("Remote URL is invalid " + remoteRepository.getRemoteUrl(), e);
            throw new InvalidRemoteUrlException();
        } catch (GitAPIException | IOException e) {
            logger.error("Error while adding remote " + remoteRepository.getRemoteName() + " (url: " + remoteRepository.getRemoteUrl() + ") " + "for site " + siteId, e);
            throw new ServiceLayerException("Error while adding remote " + remoteRepository.getRemoteName() + " (url: " + remoteRepository.getRemoteUrl() + ") for site " + siteId, e);
        }
        if (isValid) {
            insertRemoteToDb(siteId, remoteRepository);
        }
    } catch (CryptoException e) {
        throw new ServiceLayerException(e);
    } finally {
        generalLockService.unlock(gitLockKey);
    }
    return isValid;
}
Also used : URIish(org.eclipse.jgit.transport.URIish) DeleteBranchCommand(org.eclipse.jgit.api.DeleteBranchCommand) RemoteConfig(org.eclipse.jgit.transport.RemoteConfig) Config(org.eclipse.jgit.lib.Config) RemoteRemoveCommand(org.eclipse.jgit.api.RemoteRemoveCommand) RemoteAddCommand(org.eclipse.jgit.api.RemoteAddCommand) ArrayList(java.util.ArrayList) ServiceLayerException(org.craftercms.studio.api.v1.exception.ServiceLayerException) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) InvalidRemoteUrlException(org.craftercms.studio.api.v1.exception.repository.InvalidRemoteUrlException) RemoteAlreadyExistsException(org.craftercms.studio.api.v1.exception.repository.RemoteAlreadyExistsException) GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) RemoteRepository(org.craftercms.studio.api.v2.dal.RemoteRepository) Repository(org.eclipse.jgit.lib.Repository) ContentRepository(org.craftercms.studio.api.v1.repository.ContentRepository) Ref(org.eclipse.jgit.lib.Ref) Git(org.eclipse.jgit.api.Git) GitRepositoryHelper(org.craftercms.studio.api.v2.utils.GitRepositoryHelper) CryptoException(org.craftercms.commons.crypto.CryptoException)

Example 25 with PATTERN_SITE

use of org.craftercms.studio.api.v1.constant.StudioConstants.PATTERN_SITE in project studio by craftercms.

the class StudioClusterSandboxRepoSyncTask method createSiteFromRemote.

protected boolean createSiteFromRemote(String siteId, long localNodeId, List<ClusterSiteRecord> clusterSiteRecords) throws CryptoException, ServiceLayerException {
    // Clone from the first node in the cluster (it doesn't matter which one to clone from, so pick the first)
    // we will eventually to catch up to the latest
    boolean cloned = false;
    int idx = 0;
    String gitLockKey = SITE_SANDBOX_REPOSITORY_GIT_LOCK.replaceAll(PATTERN_SITE, siteId);
    if (generalLockService.tryLock(gitLockKey)) {
        try {
            Optional<ClusterSiteRecord> csr = clusterSiteRecords.stream().filter(x -> StringUtils.equals(x.getState(), STATE_CREATED) && !(x.getClusterNodeId() == localNodeId)).findFirst();
            if (csr.isPresent()) {
                ClusterMember remoteNode = clusterDao.getMemberById(csr.get().getClusterNodeId());
                logger.debug("Cloning " + SANDBOX + " repository for site " + siteId + " from " + remoteNode.getLocalAddress());
                // prepare a new folder for the cloned repository
                Path siteSandboxPath = buildRepoPath(siteId);
                File localPath = siteSandboxPath.toFile();
                // then clone
                logger.debug("Cloning from " + remoteNode.getGitUrl() + " to " + localPath);
                CloneCommand cloneCommand = Git.cloneRepository();
                Git cloneResult = null;
                try {
                    if (localPath.exists()) {
                        FileUtils.forceDelete(localPath);
                    }
                    final Path tempKey = Files.createTempFile(UUID.randomUUID().toString(), ".tmp");
                    logger.debug("Add user credentials if provided");
                    studioClusterUtils.configureAuthenticationForCommand(remoteNode, cloneCommand, tempKey);
                    String cloneUrl = remoteNode.getGitUrl().replace("{siteId}", siteId);
                    cloneUrl = cloneUrl + "/" + studioConfiguration.getProperty(SANDBOX_PATH);
                    logger.debug("Executing clone command");
                    Git gitClone = cloneResult = cloneCommand.setURI(cloneUrl).setRemote(remoteNode.getGitRemoteName()).setDirectory(localPath).setCloneAllBranches(true).call();
                    Files.deleteIfExists(tempKey);
                    cloned = validateRepository(gitClone.getRepository());
                } catch (InvalidRemoteException e) {
                    logger.error("Invalid remote repository: " + remoteNode.getGitRemoteName() + " (" + remoteNode.getGitUrl() + ")", e);
                } catch (TransportException e) {
                    if (StringUtils.endsWithIgnoreCase(e.getMessage(), "not authorized")) {
                        logger.error("Bad credentials or read only repository: " + remoteNode.getGitRemoteName() + " (" + remoteNode.getGitUrl() + ")", e);
                    } else {
                        logger.error("Remote repository not found: " + remoteNode.getGitRemoteName() + " (" + remoteNode.getGitUrl() + ")", e);
                    }
                } catch (GitAPIException | IOException e) {
                    logger.error("Error while creating repository for site with path" + siteSandboxPath, e);
                } finally {
                    if (cloneResult != null) {
                        cloneResult.close();
                    }
                }
            }
        } finally {
            generalLockService.unlock(gitLockKey);
        }
    } else {
        logger.debug("Failed to get lock " + gitLockKey);
    }
    return cloned;
}
Also used : PullCommand(org.eclipse.jgit.api.PullCommand) URISyntaxException(java.net.URISyntaxException) SITES_REPOS_PATH(org.craftercms.studio.api.v2.utils.StudioConfiguration.SITES_REPOS_PATH) StringUtils(org.apache.commons.lang3.StringUtils) InvalidRemoteUrlException(org.craftercms.studio.api.v1.exception.repository.InvalidRemoteUrlException) Config(org.eclipse.jgit.lib.Config) ClusterSiteRecord(org.craftercms.studio.api.v2.dal.ClusterSiteRecord) Map(java.util.Map) URIish(org.eclipse.jgit.transport.URIish) ClusterDAO(org.craftercms.studio.api.v2.dal.ClusterDAO) RemoteAddCommand(org.eclipse.jgit.api.RemoteAddCommand) Path(java.nio.file.Path) STATE_CREATED(org.craftercms.studio.api.v1.dal.SiteFeed.STATE_CREATED) FileRepositoryBuilder(org.eclipse.jgit.storage.file.FileRepositoryBuilder) HierarchicalConfiguration(org.apache.commons.configuration2.HierarchicalConfiguration) GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) SiteFeed(org.craftercms.studio.api.v1.dal.SiteFeed) Set(java.util.Set) SiteService(org.craftercms.studio.api.v1.service.site.SiteService) UUID(java.util.UUID) SITE_SANDBOX_REPOSITORY_GIT_LOCK(org.craftercms.studio.api.v1.constant.StudioConstants.SITE_SANDBOX_REPOSITORY_GIT_LOCK) CONFIG_PARAMETER_URL(org.craftercms.studio.impl.v1.repository.git.GitContentRepositoryConstants.CONFIG_PARAMETER_URL) Objects(java.util.Objects) CONFIG_SECTION_REMOTE(org.craftercms.studio.impl.v1.repository.git.GitContentRepositoryConstants.CONFIG_SECTION_REMOTE) List(java.util.List) StudioConfiguration(org.craftercms.studio.api.v2.utils.StudioConfiguration) PATTERN_SITE(org.craftercms.studio.api.v1.constant.StudioConstants.PATTERN_SITE) ServiceLayerException(org.craftercms.studio.api.v1.exception.ServiceLayerException) Optional(java.util.Optional) CLUSTER_NODE_REMOTE_NAME_PREFIX(org.craftercms.studio.impl.v1.repository.git.GitContentRepositoryConstants.CLUSTER_NODE_REMOTE_NAME_PREFIX) ClusterMember(org.craftercms.studio.api.v2.dal.ClusterMember) SANDBOX_PATH(org.craftercms.studio.api.v2.utils.StudioConfiguration.SANDBOX_PATH) CloneCommand(org.eclipse.jgit.api.CloneCommand) Logger(org.craftercms.studio.api.v1.log.Logger) HashMap(java.util.HashMap) DeploymentService(org.craftercms.studio.api.v1.service.deployment.DeploymentService) CollectionUtils(org.apache.commons.collections4.CollectionUtils) RemoteSetUrlCommand(org.eclipse.jgit.api.RemoteSetUrlCommand) EventService(org.craftercms.studio.api.v1.service.event.EventService) ImmutableNode(org.apache.commons.configuration2.tree.ImmutableNode) EVENT_PREVIEW_SYNC(org.craftercms.studio.api.v1.ebus.EBusConstants.EVENT_PREVIEW_SYNC) LoggerFactory(org.craftercms.studio.api.v1.log.LoggerFactory) PreviewEventContext(org.craftercms.studio.api.v1.ebus.PreviewEventContext) RemoteRepository(org.craftercms.studio.api.v2.dal.RemoteRepository) StudioConstants(org.craftercms.studio.api.v1.constant.StudioConstants) Files(java.nio.file.Files) StudioClusterUtils(org.craftercms.studio.impl.v2.service.cluster.StudioClusterUtils) FileUtils(org.apache.commons.io.FileUtils) IOException(java.io.IOException) SiteNotFoundException(org.craftercms.studio.api.v1.exception.SiteNotFoundException) ContentRepository(org.craftercms.studio.api.v1.repository.ContentRepository) CryptoException(org.craftercms.commons.crypto.CryptoException) File(java.io.File) Deployer(org.craftercms.studio.api.v2.deployment.Deployer) TransportException(org.eclipse.jgit.api.errors.TransportException) GIT_ROOT(org.craftercms.studio.impl.v1.repository.git.GitContentRepositoryConstants.GIT_ROOT) SANDBOX(org.craftercms.studio.api.v1.constant.GitRepositories.SANDBOX) InvalidRemoteException(org.eclipse.jgit.api.errors.InvalidRemoteException) Paths(java.nio.file.Paths) GeneralLockService(org.craftercms.studio.api.v1.service.GeneralLockService) REPO_BASE_PATH(org.craftercms.studio.api.v2.utils.StudioConfiguration.REPO_BASE_PATH) Git(org.eclipse.jgit.api.Git) Repository(org.eclipse.jgit.lib.Repository) Path(java.nio.file.Path) CloneCommand(org.eclipse.jgit.api.CloneCommand) IOException(java.io.IOException) ClusterSiteRecord(org.craftercms.studio.api.v2.dal.ClusterSiteRecord) TransportException(org.eclipse.jgit.api.errors.TransportException) GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) ClusterMember(org.craftercms.studio.api.v2.dal.ClusterMember) Git(org.eclipse.jgit.api.Git) InvalidRemoteException(org.eclipse.jgit.api.errors.InvalidRemoteException) File(java.io.File)

Aggregations

Repository (org.eclipse.jgit.lib.Repository)25 Git (org.eclipse.jgit.api.Git)23 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)23 ContentRepository (org.craftercms.studio.api.v1.repository.ContentRepository)21 RemoteRepository (org.craftercms.studio.api.v2.dal.RemoteRepository)21 ServiceLayerException (org.craftercms.studio.api.v1.exception.ServiceLayerException)20 GitRepositoryHelper (org.craftercms.studio.api.v2.utils.GitRepositoryHelper)20 IOException (java.io.IOException)17 CryptoException (org.craftercms.commons.crypto.CryptoException)16 Path (java.nio.file.Path)14 UserNotFoundException (org.craftercms.studio.api.v1.exception.security.UserNotFoundException)12 File (java.io.File)7 CommitCommand (org.eclipse.jgit.api.CommitCommand)6 Status (org.eclipse.jgit.api.Status)6 InvalidRemoteUrlException (org.craftercms.studio.api.v1.exception.repository.InvalidRemoteUrlException)5 InvalidRemoteException (org.eclipse.jgit.api.errors.InvalidRemoteException)5 InvalidRemoteRepositoryCredentialsException (org.craftercms.studio.api.v1.exception.repository.InvalidRemoteRepositoryCredentialsException)4 InvalidRemoteRepositoryException (org.craftercms.studio.api.v1.exception.repository.InvalidRemoteRepositoryException)4 RemoteRepositoryNotFoundException (org.craftercms.studio.api.v1.exception.repository.RemoteRepositoryNotFoundException)4 AddCommand (org.eclipse.jgit.api.AddCommand)4