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

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: org.guvnor/guvnor-project-backend

@Test
public void testReImport() throws Exception {
  when(path.getFileName()).thenReturn("pom.xml");
  when(path.toURI()).thenReturn("file://project1/pom.xml");
  when(resourceResolver.resolveProject(any(Path.class))).thenReturn(project);
  abstractProjectService.reImport(path);
  verify(invalidateDMOCache).fire(any(InvalidateDMOProjectCacheEvent.class));
}
origin: org.guvnor/guvnor-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 Project project = resourceResolver.resolveProject(path);

      invalidateDMOCache.fire(new InvalidateDMOProjectCacheEvent(sessionInfo,
                                    project,
                                    path));
    } catch (final Exception e) {
      throw ExceptionUtilities.handleException(e);
    }
  }
}
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

  @Test
  public void testRenameEventFiredBeforeDeleteEvent() {
    when(path.getFileName()).thenReturn("pom.xml");
    when(path.toURI()).thenReturn("file://project1/pom.xml");
    when(resourceResolver.resolveProject(any(Path.class))).thenReturn(project);
    when(pomService.load(any())).thenReturn(mock(POM.class));

    final InOrder inOrder = inOrder(renameProjectEvent,
                    ioService);

    abstractProjectService.rename(path,
                   "newName",
                   "comment");

    inOrder.verify(renameProjectEvent).fire(any());
    inOrder.verify(ioService).endBatch();
  }
}
origin: org.guvnor/guvnor-project-backend

@Override
public boolean isPom(final Path resource) {
  try {
    //Null resource paths cannot resolve to a Project
    if (resource == null) {
      return false;
    }
    //Check if path equals pom.xml
    final Project project = resolveProject(resource);
    //It's possible that the Incremental Build attempts to act on a Project file before the project has been fully created.
    //This should be a short-term issue that will be resolved when saving a project 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 (project == 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(project.getPomXMLPath());
    return path.startsWith(pomFilePath);
  } catch (Exception e) {
    throw ExceptionUtilities.handleException(e);
  }
}
origin: org.guvnor/guvnor-project-backend

public Set<Project> getProjects(final Repository repository,
                String branch,
                boolean secure) {
  final Set<Project> authorizedProjects = new HashSet<Project>();
  if (repository == null) {
    return authorizedProjects;
  }
  final Path repositoryRoot = repository.getBranchRoot(branch);
  final DirectoryStream<org.uberfire.java.nio.file.Path> nioRepositoryPaths = ioService.newDirectoryStream(Paths.convert(repositoryRoot));
  try {
    for (org.uberfire.java.nio.file.Path nioRepositoryPath : nioRepositoryPaths) {
      if (Files.isDirectory(nioRepositoryPath)) {
        final org.uberfire.backend.vfs.Path projectPath = Paths.convert(nioRepositoryPath);
        final Project project = resourceResolver.resolveProject(projectPath);
        if (project != null) {
          if (!secure || authorizationManager.authorize(project,
                                 sessionInfo.getIdentity())) {
            POM projectPom = pomService.load(project.getPomXMLPath());
            project.setPom(projectPom);
            authorizedProjects.add(project);
          }
        }
      }
    }
  } finally {
    nioRepositoryPaths.close();
  }
  return authorizedProjects;
}
origin: org.guvnor/guvnor-project-backend

final Project oldProject = resourceResolver.resolveProject(oldProjectDir);
  throw e;
} finally {
  final Project newProject = resourceResolver.resolveProject(Paths.convert(newProjectPath));
  renameProjectEvent.fire(new RenameProjectEvent(oldProject,
                          newProject));
origin: org.guvnor/guvnor-project-backend

  ioService.endBatch();
final Project newProject = resourceResolver.resolveProject(Paths.convert(newProjectPath));
newProjectEvent.fire(new NewProjectEvent(newProject,
                     commentedOptionFactory.getSafeSessionId(),
origin: org.guvnor/guvnor-project-backend

@Override
public void delete(final Path pathToPomXML,
          final String comment) {
  try {
    final org.uberfire.java.nio.file.Path projectDirectory = Paths.convert(pathToPomXML).getParent();
    final Project project2Delete = resourceResolver.resolveProject(Paths.convert(projectDirectory));
    final org.uberfire.java.nio.file.Path parentPom = projectDirectory.getParent().resolve(POM_PATH);
    POM parent = null;
    if (ioService.exists(parentPom)) {
      parent = pomService.load(Paths.convert(parentPom));
    }
    ioService.delete(projectDirectory,
             StandardDeleteOption.NON_EMPTY_DIRECTORIES,
             commentedOptionFactory.makeCommentedOption(comment));
    //Note we do *not* raise a DeleteProjectEvent here, as that is handled by DeleteProjectObserverBridge
    if (parent != null) {
      parent.setPackaging("pom");
      parent.getModules().remove(project2Delete.getProjectName());
      pomService.save(Paths.convert(parentPom),
              parent,
              null,
              "Removing child module " + project2Delete.getProjectName());
    }
  } catch (final Exception e) {
    throw ExceptionUtilities.handleException(e);
  }
}
org.guvnor.common.services.project.backend.serverResourceResolverresolveProject

Popular methods of ResourceResolver

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

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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