Tabnine Logo
ResourceResolver.resolveModule
Code IndexAdd Tabnine to your IDE (free)

How to use
resolveModule
method
in
org.guvnor.common.services.project.backend.server.ResourceResolver

Best Java code snippets using org.guvnor.common.services.project.backend.server.ResourceResolver.resolveModule (Showing top 20 results out of 315)

origin: org.kie.workbench.services/kie-wb-common-services-backend

@Override
public KieModule resolveModule(Path resource, boolean loadPOM) {
  return (KieModule) resourceResolver.resolveModule(resource, loadPOM);
}
origin: kiegroup/appformer

@Override
public T resolveModule(final Path resource) {
  return resolveModule(resource, true);
}
origin: org.uberfire/uberfire-project-backend

@Override
public T resolveModule(final Path resource) {
  return resolveModule(resource, true);
}
origin: org.kie.workbench.services/kie-wb-common-services-backend

@Override
public KieModule resolveModule(final Path resource) {
  return (KieModule) resourceResolver.resolveModule(resource);
}
origin: org.uberfire/uberfire-project-backend

@Test
public void testReImport() throws Exception {
  when(path.getFileName()).thenReturn("pom.xml");
  when(path.toURI()).thenReturn("file://project1/pom.xml");
  when(resourceResolver.resolveModule(any(Path.class))).thenReturn(module);
  abstractProjectService.reImport(path);
  verify(invalidateDMOCache).fire(any(InvalidateDMOModuleCacheEvent.class));
}
origin: org.uberfire/uberfire-project-backend

  @Override
  public void reImport(final Path pathToPomXML) {

    try {
      final org.uberfire.java.nio.file.Path projectDirectory = Paths.convert(pathToPomXML).getParent();
      final Path path = Paths.convert(projectDirectory);
      final Module module = resourceResolver.resolveModule(path);

      invalidateDMOCache.fire(new InvalidateDMOModuleCacheEvent(sessionInfo,
                                   module,
                                   path));
    } catch (final Exception e) {
      throw ExceptionUtilities.handleException(e);
    }
  }
}
origin: kiegroup/appformer

@Test
public void testReImport() throws Exception {
  when(path.getFileName()).thenReturn("pom.xml");
  when(path.toURI()).thenReturn("file://project1/pom.xml");
  when(resourceResolver.resolveModule(any(Path.class))).thenReturn(module);
  abstractProjectService.reImport(path);
  verify(invalidateDMOCache).fire(any(InvalidateDMOModuleCacheEvent.class));
}
origin: kiegroup/appformer

  @Override
  public void reImport(final Path pathToPomXML) {

    try {
      final org.uberfire.java.nio.file.Path projectDirectory = Paths.convert(pathToPomXML).getParent();
      final Path path = Paths.convert(projectDirectory);
      final Module module = resourceResolver.resolveModule(path);

      invalidateDMOCache.fire(new InvalidateDMOModuleCacheEvent(sessionInfo,
                                   module,
                                   path));
    } catch (final Exception e) {
      throw ExceptionUtilities.handleException(e);
    }
  }
}
origin: kiegroup/appformer

@Override
public org.guvnor.common.services.project.model.Package resolvePackage(final Path resource) {
  try {
    //Null resource paths cannot resolve to a Module
    if (resource == null) {
      return null;
    }
    //If Path is not within a Module we cannot resolve a package
    final Module module = resolveModule(resource);
    if (module == null) {
      return null;
    }
    //pom.xml is not inside a package
    if (isPom(resource)) {
      return null;
    }
    return makePackage(module,
              resource);
  } catch (Exception e) {
    throw ExceptionUtilities.handleException(e);
  }
}
origin: org.uberfire/uberfire-project-backend

@Override
public org.guvnor.common.services.project.model.Package resolvePackage(final Path resource) {
  try {
    //Null resource paths cannot resolve to a Module
    if (resource == null) {
      return null;
    }
    //If Path is not within a Module we cannot resolve a package
    final Module module = resolveModule(resource);
    if (module == null) {
      return null;
    }
    //pom.xml is not inside a package
    if (isPom(resource)) {
      return null;
    }
    return makePackage(module,
              resource);
  } catch (Exception e) {
    throw ExceptionUtilities.handleException(e);
  }
}
origin: org.uberfire/uberfire-project-backend

@Test
public void testUseRepoServiceToDeleteRootModule() {
  when(path.getFileName()).thenReturn("pom.xml");
  when(path.toURI()).thenReturn("file:///space/project1/pom.xml");
  when(resourceResolver.resolveModule(any(Path.class))).thenReturn(module);
  when(pomService.load(any())).thenReturn(mock(POM.class));
  Repository repo = mock(Repository.class);
  when(repoService.getRepository(eq(org.uberfire.backend.server.util.Paths.convert(Paths.get("file:///space/project1"))))).thenReturn(repo);
  String alias = "repo-alias";
  when(repo.getAlias()).thenReturn(alias);
  Space space = new Space("space");
  when(repo.getSpace()).thenReturn(space);
  abstractProjectService.delete(path, "");
  verify(repoService).removeRepository(eq(space), eq(alias));
  verify(ioService, times(0)).delete(any(), any());
}
origin: kiegroup/appformer

@Test
public void testUseRepoServiceToDeleteRootModule() {
  when(path.getFileName()).thenReturn("pom.xml");
  when(path.toURI()).thenReturn("file:///space/project1/pom.xml");
  when(resourceResolver.resolveModule(any(Path.class))).thenReturn(module);
  when(pomService.load(any())).thenReturn(mock(POM.class));
  Repository repo = mock(Repository.class);
  when(repoService.getRepository(eq(org.uberfire.backend.server.util.Paths.convert(Paths.get("file:///space/project1"))))).thenReturn(repo);
  String alias = "repo-alias";
  when(repo.getAlias()).thenReturn(alias);
  Space space = new Space("space");
  when(repo.getSpace()).thenReturn(space);
  abstractProjectService.delete(path, "");
  verify(repoService).removeRepository(eq(space), eq(alias));
  verify(ioService, times(0)).delete(any(), any());
}
origin: org.uberfire/uberfire-project-backend

  @Test
  public void testUseIOServiceToDeleteSubModule() {
    when(path.getFileName()).thenReturn("pom.xml");
    when(path.toURI()).thenReturn("file://space/project1/subproject/pom.xml");
    when(ioService.exists(any())).thenReturn(true);
    when(resourceResolver.resolveModule(any(Path.class))).thenReturn(module);
    when(pomService.load(any())).thenReturn(mock(POM.class));
    Repository repo = mock(Repository.class);
    when(repoService.getRepository(path)).thenReturn(repo);
    String alias = "repo-alias";
    when(repo.getAlias()).thenReturn(alias);
    Space space = new Space("space");
    when(repo.getSpace()).thenReturn(space);

    abstractProjectService.delete(path, "");

    verify(repoService, times(0)).removeRepository(any(), any());
    verify(ioService).delete(eq(Paths.get("file://space/project1/subproject")), anyVararg());
  }
}
origin: kiegroup/appformer

  @Test
  public void testUseIOServiceToDeleteSubModule() {
    when(path.getFileName()).thenReturn("pom.xml");
    when(path.toURI()).thenReturn("file://space/project1/subproject/pom.xml");
    when(ioService.exists(any())).thenReturn(true);
    when(resourceResolver.resolveModule(any(Path.class))).thenReturn(module);
    when(pomService.load(any())).thenReturn(mock(POM.class));
    Repository repo = mock(Repository.class);
    when(repoService.getRepository(path)).thenReturn(repo);
    String alias = "repo-alias";
    when(repo.getAlias()).thenReturn(alias);
    Space space = new Space("space");
    when(repo.getSpace()).thenReturn(space);

    abstractProjectService.delete(path, "");

    verify(repoService, times(0)).removeRepository(any(), any());
    verify(ioService).delete(eq(Paths.get("file://space/project1/subproject")), anyVararg());
  }
}
origin: org.uberfire/uberfire-project-backend

private void findModule(final org.uberfire.java.nio.file.Path folderPath,
            final boolean checkModulesFromFolders) {
  final org.uberfire.java.nio.file.Path pomPath = folderPath.resolve(POM_PATH);
  if (Files.exists(pomPath)) {
    final Module module = resourceResolver.resolveModule(Paths.convert(pomPath));
    if (module != null) {
      addModule(module);
    } else if (checkModulesFromFolders) {
      lookForModulesFromFolders(folderPath);
    }
  } else if (checkModulesFromFolders) {
    lookForModulesFromFolders(folderPath);
  }
}
origin: kiegroup/appformer

private void findModule(final org.uberfire.java.nio.file.Path folderPath,
            final boolean checkModulesFromFolders) {
  final org.uberfire.java.nio.file.Path pomPath = folderPath.resolve(POM_PATH);
  if (Files.exists(pomPath)) {
    final Module module = resourceResolver.resolveModule(Paths.convert(pomPath));
    if (module != null) {
      addModule(module);
    } else if (checkModulesFromFolders) {
      lookForModulesFromFolders(folderPath);
    }
  } else if (checkModulesFromFolders) {
    lookForModulesFromFolders(folderPath);
  }
}
origin: kiegroup/appformer

try {
  final org.uberfire.java.nio.file.Path projectDirectory = Paths.convert(pathToPomXML).getParent();
  final Module module2Delete = resourceResolver.resolveModule(Paths.convert(projectDirectory));
origin: org.uberfire/uberfire-project-backend

try {
  final org.uberfire.java.nio.file.Path projectDirectory = Paths.convert(pathToPomXML).getParent();
  final Module module2Delete = resourceResolver.resolveModule(Paths.convert(projectDirectory));
origin: org.uberfire/uberfire-project-backend

@Override
public boolean isPom(final Path resource) {
  try {
    //Null resource paths cannot resolve to a Module
    if (resource == null) {
      return false;
    }
    //Check if path equals pom.xml
    final Module module = resolveModule(resource);
    //It's possible that the Incremental Build attempts to act on a Module file before the module has been fully created.
    //This should be a short-term issue that will be resolved when saving a module batches pom.xml, kmodule.xml and project.imports
    //etc into a single git-batch. At present they are saved individually leading to multiple Incremental Build requests.
    if (module == null) {
      return false;
    }
    final org.uberfire.java.nio.file.Path path = Paths.convert(resource).normalize();
    final org.uberfire.java.nio.file.Path pomFilePath = Paths.convert(module.getPomXMLPath());
    return path.startsWith(pomFilePath);
  } catch (Exception e) {
    throw ExceptionUtilities.handleException(e);
  }
}
origin: kiegroup/appformer

@Override
public boolean isPom(final Path resource) {
  try {
    //Null resource paths cannot resolve to a Module
    if (resource == null) {
      return false;
    }
    //Check if path equals pom.xml
    final Module module = resolveModule(resource);
    //It's possible that the Incremental Build attempts to act on a Module file before the module has been fully created.
    //This should be a short-term issue that will be resolved when saving a module batches pom.xml, kmodule.xml and project.imports
    //etc into a single git-batch. At present they are saved individually leading to multiple Incremental Build requests.
    if (module == null) {
      return false;
    }
    final org.uberfire.java.nio.file.Path path = Paths.convert(resource).normalize();
    final org.uberfire.java.nio.file.Path pomFilePath = Paths.convert(module.getPomXMLPath());
    return path.startsWith(pomFilePath);
  } catch (Exception e) {
    throw ExceptionUtilities.handleException(e);
  }
}
org.guvnor.common.services.project.backend.serverResourceResolverresolveModule

Popular methods of ResourceResolver

  • resolvePackage
  • getDefaultWorkspacePath
  • isPom
  • resolveDefaultPath
  • resolveDefaultWorkspacePackage
  • getLegalId
  • getPackageDisplayName
  • getPackageNames
  • getPackagePathSuffix
  • getPackageRelativeCaption
  • hasPom
  • initResourcePathResolvers
  • hasPom,
  • initResourcePathResolvers,
  • makePackage,
  • newPackage,
  • resolvePkgName,
  • resolveProject,
  • simpleModuleInstance,
  • addSecurityGroups,
  • findProjectConfig

Popular in Java

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • setRequestProperty (URLConnection)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now