public interface ResourceLoader
ToolingArtifact resources with the
resource:: prefix or just as relative paths. This resource loader honors the class loader filtering rules defined by
the application and plugins as in Runtime environments.| Modifier and Type | Method and Description |
|---|---|
default Optional<URL> |
findIn(String resource,
String groupId,
String artifactId,
Optional<String> version)
Same as
findIn(String, String, String, Optional, String, String) but using no classifier and jar as type. |
Optional<URL> |
findIn(String resource,
String groupId,
String artifactId,
Optional<String> version,
String classifier,
String type)
Looks for a resource based on the calling class classloader and the current context classloader, specifically within the
artifact specified by it's GAV coordinates, considering it's classifier and type as well.
|
URL |
getResource(String resource)
Returns the resources
URL, useful when the actual resource will be loaded by another component. |
InputStream |
getResourceAsStream(String resource)
Returns an
InputStream with the resource's data ready to be consumed. |
default Optional<InputStream> |
loadFrom(String resource,
String groupId,
String artifactId,
Optional<String> version)
Same as
loadFrom(String, String, String, Optional, String, String) but using no classifier and jar as type. |
Optional<InputStream> |
loadFrom(String resource,
String groupId,
String artifactId,
Optional<String> version,
String classifier,
String type)
Looks for a resource as in
findIn(String, String, String, Optional, String, String) and returns it's
InputStream if possible. |
InputStream getResourceAsStream(String resource)
InputStream with the resource's data ready to be consumed.resource - the resource to be found.URL getResource(String resource)
URL, useful when the actual resource will be loaded by another component.resource - the resource to be found.default Optional<InputStream> loadFrom(String resource, String groupId, String artifactId, Optional<String> version)
loadFrom(String, String, String, Optional, String, String) but using no classifier and jar as type.resource - the name of the resource to loadgroupId - the group ID of the artifact where to lookartifactId - the artifact ID of the artifact where to lookversion - the optional version of the artifact where to lookOptional<InputStream> loadFrom(String resource, String groupId, String artifactId, Optional<String> version, String classifier, String type)
findIn(String, String, String, Optional, String, String) and returns it's
InputStream if possible.resource - the name of the resource to loadgroupId - the group ID of the artifact where to lookartifactId - the artifact ID of the artifact where to lookversion - the optional version of the artifact where to lookclassifier - the classifier of the artifact where to looktype - the type of the artifact where to lookOptional<URL> findIn(String resource, String groupId, String artifactId, Optional<String> version, String classifier, String type)
resource - the name of the resource to loadgroupId - the group ID of the artifact where to lookartifactId - the artifact ID of the artifact where to lookversion - the optional version of the artifact where to lookclassifier - the classifier of the artifact where to looktype - the type of the artifact where to lookURL for this resourcedefault Optional<URL> findIn(String resource, String groupId, String artifactId, Optional<String> version)
findIn(String, String, String, Optional, String, String) but using no classifier and jar as type.resource - the name of the resource to loadgroupId - the group ID of the artifact where to lookartifactId - the artifact ID of the artifact where to lookversion - the optional version of the artifact where to lookURL for this resourceCopyright © 2023 MuleSoft, Inc.. All rights reserved.