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

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

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

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

  @Override
  public Package resolvePackage(final Path resource) {
    return resourceResolver.resolvePackage(resource);
  }
}
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.kie.workbench.services/kie-wb-common-services-backend

@Override
public Path resolveDefaultPath(Package pkg,
                String resourceType) {
  return resourceResolver.resolveDefaultPath(pkg,
                        resourceType);
}
origin: org.guvnor/guvnor-project-backend

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

for (String src : SOURCE_PATHS) {
  final org.uberfire.java.nio.file.Path nioPackageRootSrcPath = nioProjectRootPath.resolve(src);
  packageNames.addAll(getPackageNames(nioProjectRootPath,
                    nioPackageRootSrcPath,
                    true,
    final org.uberfire.java.nio.file.Path nioPackagePath = nioProjectRootPath.resolve(src).resolve(packagePathSuffix);
    if (Files.exists(nioPackagePath) && !resolvedPackages.contains(packagePathSuffix)) {
      packages.add(resolvePackage(Paths.convert(nioPackagePath)));
      resolvedPackages.add(packagePathSuffix);
origin: org.guvnor/guvnor-project-backend

@Override
public Package resolveDefaultWorkspacePackage(final Project project) {
  final Path projectRootPath = project.getRootPath();
  final GAV gav = project.getPom().getGav();
  final String defaultWorkspacePackagePath = getDefaultWorkspacePath(gav);
  final org.uberfire.java.nio.file.Path defaultWorkspacePath = Paths.convert(projectRootPath).resolve(MAIN_RESOURCES_PATH + "/" + defaultWorkspacePackagePath);
  return resolvePackage(Paths.convert(defaultWorkspacePath));
}
origin: org.guvnor/guvnor-project-backend

final org.uberfire.java.nio.file.Path nioPackageRootSrcPath = nioProjectRootPath.resolve(src).resolve(resolvePkgName(pkg.getCaption()));
packageNames.addAll(getPackageNames(nioProjectRootPath,
                  nioPackageRootSrcPath,
                  false,
  final org.uberfire.java.nio.file.Path nioPackagePath = nioProjectRootPath.resolve(src).resolve(packagePathSuffix);
  if (Files.exists(nioPackagePath) && !resolvedPackages.contains(packagePathSuffix)) {
    packages.add(resolvePackage(Paths.convert(nioPackagePath)));
    resolvedPackages.add(packagePathSuffix);
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: org.uberfire/uberfire-project-backend

@Test
public void getDefaultWorkspacePathTest() {
  final Module project = mock(Module.class);
  final POM pom = mock(POM.class);
  doReturn(pom).when(project).getPom();
  final GAV gav = mock(GAV.class);
  doReturn(gav).when(pom).getGav();
  final Path path = mock(Path.class);
  doReturn(path).when(project).getRootPath();
  when(path.toURI()).thenReturn("file:///myproject/");
  doReturn("com.group").when(gav).getGroupId();
  doReturn("package").when(gav).getArtifactId();
  final ArgumentCaptor<Path> packagePathArgumentCaptor = ArgumentCaptor.forClass(Path.class);
  resourceResolver.resolveDefaultWorkspacePackage(project);
  verify(resourceResolver).resolvePackage(packagePathArgumentCaptor.capture());
  final Path packagePath = packagePathArgumentCaptor.getValue();
  assertEquals("file:///myproject/src/main/resources/com/group/_package",
         packagePath.toURI());
}
origin: org.guvnor/guvnor-project-backend

@Test
public void resolveDefaultWorkspacePackageTest() {
  final GAV gav = mock(GAV.class);
  doReturn("com.group").when(gav).getGroupId();
  doReturn("package").when(gav).getArtifactId();
  assertEquals("com/group/_package",
         resourceResolver.getDefaultWorkspacePath(gav));
}
origin: org.uberfire/uberfire-project-backend

  packageNames.add(getPackagePathSuffix(nioModuleRootPath,
                     nioPackageSrcPath));
for (org.uberfire.java.nio.file.Path nioChildPackageSrcPath : nioChildPackageSrcPaths) {
  if (recursive) {
    packageNames.addAll(getPackageNames(nioModuleRootPath,
                      nioChildPackageSrcPath,
                      includeDefault,
                      recursive));
  } else {
    packageNames.add(getPackagePathSuffix(nioModuleRootPath,
                       nioChildPackageSrcPath));
origin: kiegroup/appformer

final Path testResourcesPath = Paths.convert(nioTestResourcesPath.resolve(packagePath));
final String displayName = getPackageDisplayName(packageName);
                packageName,
                displayName,
                getPackageRelativeCaption(displayName,
                             resource.getFileName()));
return pkg;
origin: org.kie.workbench.services/kie-wb-common-services-backend

@Override
public Package resolveDefaultWorkspacePackage(final Module project) {
  return resourceResolver.resolveDefaultWorkspacePackage(project);
}
origin: org.kie.workbench.services/kie-wb-common-services-backend

@Override
public boolean isPom(final Path resource) {
  return resourceResolver.isPom(resource);
}
origin: kiegroup/appformer

public String getDefaultWorkspacePath(final GAV gav) {
  return StringUtils.join(getLegalId(gav.getGroupId()),
              "/") + "/" + StringUtils.join(getLegalId(gav.getArtifactId()),
                             "/");
}
origin: org.uberfire/uberfire-project-backend

for (String src : SOURCE_PATHS) {
  final org.uberfire.java.nio.file.Path nioPackageRootSrcPath = nioModuleRootPath.resolve(src);
  packageNames.addAll(getPackageNames(nioModuleRootPath,
                    nioPackageRootSrcPath,
                    true,
    final org.uberfire.java.nio.file.Path nioPackagePath = nioModuleRootPath.resolve(src).resolve(packagePathSuffix);
    if (Files.exists(nioPackagePath) && !resolvedPackages.contains(packagePathSuffix)) {
      packages.add(resolvePackage(Paths.convert(nioPackagePath)));
      resolvedPackages.add(packagePathSuffix);
origin: org.uberfire/uberfire-project-backend

@Override
public Package resolveDefaultWorkspacePackage(final Module module) {
  final Path moduleRootPath = module.getRootPath();
  final GAV gav = module.getPom().getGav();
  final String defaultWorkspacePackagePath = getDefaultWorkspacePath(gav);
  final org.uberfire.java.nio.file.Path defaultWorkspacePath = Paths.convert(moduleRootPath).resolve(MAIN_RESOURCES_PATH + "/" + defaultWorkspacePackagePath);
  return resolvePackage(Paths.convert(defaultWorkspacePath));
}
origin: kiegroup/appformer

final org.uberfire.java.nio.file.Path nioPackageRootSrcPath = nioModuleRootPath.resolve(src).resolve(resolvePkgName(pkg.getCaption()));
packageNames.addAll(getPackageNames(nioModuleRootPath,
                  nioPackageRootSrcPath,
                  false,
  final org.uberfire.java.nio.file.Path nioPackagePath = nioModuleRootPath.resolve(src).resolve(packagePathSuffix);
  if (Files.exists(nioPackagePath) && !resolvedPackages.contains(packagePathSuffix)) {
    packages.add(resolvePackage(Paths.convert(nioPackagePath)));
    resolvedPackages.add(packagePathSuffix);
origin: org.uberfire/uberfire-project-backend

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

@Test
public void getDefaultWorkspacePathTest() {
  final Project project = mock(Project.class);
  final POM pom = mock(POM.class);
  doReturn(pom).when(project).getPom();
  final GAV gav = mock(GAV.class);
  doReturn(gav).when(pom).getGav();
  final Path path = mock(Path.class);
  doReturn(path).when(project).getRootPath();
  when(path.toURI()).thenReturn("default:///myproject/");
  doReturn("com.group").when(gav).getGroupId();
  doReturn("package").when(gav).getArtifactId();
  final ArgumentCaptor<Path> packagePathArgumentCaptor = ArgumentCaptor.forClass(Path.class);
  resourceResolver.resolveDefaultWorkspacePackage(project);
  verify(resourceResolver).resolvePackage(packagePathArgumentCaptor.capture());
  final Path packagePath = packagePathArgumentCaptor.getValue();
  assertEquals("default:///myproject/src/main/resources/com/group/_package",
         packagePath.toURI());
}
org.guvnor.common.services.project.backend.serverResourceResolver

Most used methods

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • compareTo (BigDecimal)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top Vim plugins
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