Class AbstractResourceFinder

java.lang.Object
org.eclipse.lemminx.customservice.synapse.resourceFinder.AbstractResourceFinder
Direct Known Subclasses:
NewProjectResourceFinder, OldProjectResourceFinder

public abstract class AbstractResourceFinder extends Object
  • Field Details

  • Constructor Details

    • AbstractResourceFinder

      public AbstractResourceFinder()
  • Method Details

    • initDependentResourcesMap

      public void initDependentResourcesMap()
    • loadDependentResources

      public String loadDependentResources(String projectPath)
      Loads dependent resources for the given project path.

      This method initializes the dependent resources map and attempts to locate the dependencies directory for the specified project. If found, it iterates through each dependent project, finds resources of each type, and merges them into the dependent resources map.

      Parameters:
      projectPath - the absolute path to the project whose dependencies are to be loaded
      Throws:
      RuntimeException - if an I/O error occurs while accessing the dependencies
    • getDependentResourcesMap

      public Map<String,ResourceResponse> getDependentResourcesMap()
    • mergeResourceResponses

      protected void mergeResourceResponses(ResourceResponse response1, ResourceResponse response2)
      Merges the resources and registry resources from two ResourceResponse objects.

      If both responses are non-null, their resource lists and registry resource lists are combined to response1. If response1 is null, a new ResourceResponse is created and populated with the resources from response2.

      Parameters:
      response1 - the target ResourceResponse to merge into (may be null)
      response2 - the source ResourceResponse to merge from (may be null)
    • getAvailableResources

      public ResourceResponse getAvailableResources(String uri, org.eclipse.lsp4j.jsonrpc.messages.Either<String,List<RequestedResource>> resourceTypes)
    • findResources

      protected abstract ResourceResponse findResources(String projectPath, List<RequestedResource> type)
    • findResourceInArtifacts

      protected List<Resource> findResourceInArtifacts(Path artifactsPath, List<RequestedResource> types)
    • findResourceInLocalEntry

      protected List<Resource> findResourceInLocalEntry(Path localEntryPath, List<RequestedResource> types)
    • getArtifactFolder

      protected abstract String getArtifactFolder(String type)
    • findResourceInRegistry

      protected List<Resource> findResourceInRegistry(Path registryPath, List<RequestedResource> requestedResources)