Class AbstractResourceFinder
java.lang.Object
org.eclipse.lemminx.customservice.synapse.resourceFinder.AbstractResourceFinder
- Direct Known Subclasses:
NewProjectResourceFinder,OldProjectResourceFinder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindResourceInArtifacts(Path artifactsPath, List<RequestedResource> types) findResourceInLocalEntry(Path localEntryPath, List<RequestedResource> types) findResourceInRegistry(Path registryPath, List<RequestedResource> requestedResources) protected abstract ResourceResponsefindResources(String projectPath, List<RequestedResource> type) protected abstract StringgetArtifactFolder(String type) getAvailableResources(String uri, org.eclipse.lsp4j.jsonrpc.messages.Either<String, List<RequestedResource>> resourceTypes) voidloadDependentResources(String projectPath) Loads dependent resources for the given project path.protected voidmergeResourceResponses(ResourceResponse response1, ResourceResponse response2) Merges the resources and registry resources from twoResourceResponseobjects.
-
Field Details
-
resourceFromRegistryOnly
-
dependentResourcesMap
-
-
Constructor Details
-
AbstractResourceFinder
public AbstractResourceFinder()
-
-
Method Details
-
initDependentResourcesMap
public void initDependentResourcesMap() -
loadDependentResources
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
-
mergeResourceResponses
Merges the resources and registry resources from twoResourceResponseobjects.If both responses are non-null, their resource lists and registry resource lists are combined to
response1. Ifresponse1is null, a newResourceResponseis created and populated with the resources fromresponse2.- Parameters:
response1- the targetResourceResponseto merge into (may be null)response2- the sourceResourceResponseto merge from (may be null)
-
getAvailableResources
public ResourceResponse getAvailableResources(String uri, org.eclipse.lsp4j.jsonrpc.messages.Either<String, List<RequestedResource>> resourceTypes) -
findResources
-
findResourceInArtifacts
-
findResourceInLocalEntry
protected List<Resource> findResourceInLocalEntry(Path localEntryPath, List<RequestedResource> types) -
getArtifactFolder
-
findResourceInRegistry
protected List<Resource> findResourceInRegistry(Path registryPath, List<RequestedResource> requestedResources)
-