use of com.enonic.xp.dump.BranchLoadResult in project xp by enonic.
the class AbstractDumpReader method loadBranch.
@Override
public BranchLoadResult loadBranch(final RepositoryId repositoryId, final Branch branch, final LineProcessor<EntryLoadResult> processor) {
final PathRef tarFile = filePaths.branchMetaPath(repositoryId, branch);
listener.loadingBranch(repositoryId, branch, getBranchSuccessfulCountFromMeta(repositoryId, branch));
final BranchLoadResult.Builder builder = BranchLoadResult.create(branch);
if (!exists(tarFile)) {
return builder.build();
}
final EntriesLoadResult result = doLoadEntries(processor, tarFile);
return builder.successful(result.getSuccessful()).errors(result.getErrors().stream().map(error -> LoadError.error(error.getMessage())).collect(Collectors.toList())).build();
}
use of com.enonic.xp.dump.BranchLoadResult in project xp by enonic.
the class RepoLoader method doExecute.
private void doExecute(final RepoLoadResult.Builder result) {
final Branch currentBranch = ContextAccessor.current().getBranch();
verifyOrCreateBranch(currentBranch);
final BranchLoadResult branchLoadResult = this.reader.loadBranch(repositoryId, currentBranch, this.branchEntryProcessor);
result.add(branchLoadResult);
}
use of com.enonic.xp.dump.BranchLoadResult in project xp by enonic.
the class LoadRunnableTask method importSystemRepo.
private RepoLoadResult importSystemRepo(final Path rootDir) {
final RepoLoadResult.Builder builder = RepoLoadResult.create(SystemConstants.SYSTEM_REPO_ID);
final NodeImportResult systemRepoImport = importRepoBranch(SystemConstants.SYSTEM_REPO_ID.toString(), SystemConstants.BRANCH_SYSTEM.toString(), rootDir);
final BranchLoadResult branchLoadResult = NodeImportResultTranslator.translate(systemRepoImport, SystemConstants.BRANCH_SYSTEM);
builder.add(branchLoadResult);
return builder.build();
}
Aggregations