Interface ResourceResolverPlugin

All Superinterfaces:
CoreComponent, Plugin
All Known Implementing Classes:
ClassPathResourceResolverPlugin, LocalResourceResolverPlugin, UnsafeURLResourceResolverPlugin, URLResourceResolverPlugin

public interface ResourceResolverPlugin extends Plugin
Resolves a resource by providing its URL. This interface defines a plugin contract for resolving resources represented as strings into their corresponding URL objects. Implementations of this interface are expected to handle the conversion of a resource string into a valid URL, if possible.
Author:
prahmoune
  • Method Summary

    Modifier and Type
    Method
    Description
    resolve(String resource)
    Resolves a resource string into its corresponding URL.
  • Method Details

    • resolve

      URL resolve(String resource)
      Resolves a resource string into its corresponding URL. This method takes a string representation of a resource (e.g., a file path, URI, or other identifier) and attempts to convert it into a URL object. If the resource cannot be resolved (e.g., due to an invalid format or inaccessible resource), an empty Optional is returned.
      Parameters:
      resource - the string representation of the resource to resolve
      Returns:
      The resolved URL if successful, or null if the resource cannot be resolved
      Throws:
      NullPointerException - if the provided resource string is null