Search in sources :

Example 1 with SegmentedPath

use of org.uberfire.java.nio.base.SegmentedPath in project kie-wb-common by kiegroup.

the class AssetsUsageServiceImpl method getQueryList.

protected List<Path> getQueryList(Path assetPath, RefactorOperationBuilder<QueryOperationRequest>.RequiresModule builder) {
    KieModule project = moduleService.resolveModule(assetPath);
    String branch = "master";
    org.uberfire.java.nio.file.Path nioPath = Paths.convert(assetPath);
    if (nioPath instanceof SegmentedPath) {
        branch = ((SegmentedPath) nioPath).getSegmentId();
    }
    QueryOperationRequest request = builder.inModuleRootPathURI(project.getRootPath().toURI()).onBranch(branch);
    return refactoringQueryService.queryToList(request).stream().map(row -> (Path) row.getValue()).collect(Collectors.toList());
}
Also used : KieModule(org.kie.workbench.common.services.shared.project.KieModule) RefactorOperationBuilder(org.kie.workbench.common.services.refactoring.service.impact.RefactorOperationBuilder) AssetsUsageService(org.kie.workbench.common.services.refactoring.service.AssetsUsageService) Collectors(java.util.stream.Collectors) PartType(org.kie.workbench.common.services.refactoring.service.PartType) Paths(org.uberfire.backend.server.util.Paths) Inject(javax.inject.Inject) List(java.util.List) QueryOperationRequest(org.kie.workbench.common.services.refactoring.service.impact.QueryOperationRequest) ResourceType(org.kie.workbench.common.services.refactoring.service.ResourceType) RefactoringQueryService(org.kie.workbench.common.services.refactoring.service.RefactoringQueryService) KieModuleService(org.kie.workbench.common.services.shared.project.KieModuleService) Service(org.jboss.errai.bus.server.annotations.Service) ApplicationScoped(javax.enterprise.context.ApplicationScoped) Path(org.uberfire.backend.vfs.Path) SegmentedPath(org.uberfire.java.nio.base.SegmentedPath) Path(org.uberfire.backend.vfs.Path) SegmentedPath(org.uberfire.java.nio.base.SegmentedPath) QueryOperationRequest(org.kie.workbench.common.services.refactoring.service.impact.QueryOperationRequest) SegmentedPath(org.uberfire.java.nio.base.SegmentedPath) KieModule(org.kie.workbench.common.services.shared.project.KieModule)

Aggregations

List (java.util.List)1 Collectors (java.util.stream.Collectors)1 ApplicationScoped (javax.enterprise.context.ApplicationScoped)1 Inject (javax.inject.Inject)1 Service (org.jboss.errai.bus.server.annotations.Service)1 AssetsUsageService (org.kie.workbench.common.services.refactoring.service.AssetsUsageService)1 PartType (org.kie.workbench.common.services.refactoring.service.PartType)1 RefactoringQueryService (org.kie.workbench.common.services.refactoring.service.RefactoringQueryService)1 ResourceType (org.kie.workbench.common.services.refactoring.service.ResourceType)1 QueryOperationRequest (org.kie.workbench.common.services.refactoring.service.impact.QueryOperationRequest)1 RefactorOperationBuilder (org.kie.workbench.common.services.refactoring.service.impact.RefactorOperationBuilder)1 KieModule (org.kie.workbench.common.services.shared.project.KieModule)1 KieModuleService (org.kie.workbench.common.services.shared.project.KieModuleService)1 Paths (org.uberfire.backend.server.util.Paths)1 Path (org.uberfire.backend.vfs.Path)1 SegmentedPath (org.uberfire.java.nio.base.SegmentedPath)1