Class URLResourceProvider

java.lang.Object
com.helger.io.resourceprovider.URLResourceProvider
All Implemented Interfaces:
IReadableResourceProvider

@Immutable public final class URLResourceProvider extends Object implements IReadableResourceProvider
The URL resource provider.
Author:
Philip Helger
  • Constructor Details

    • URLResourceProvider

      public URLResourceProvider()
  • Method Details

    • supportsReading

      public boolean supportsReading(@Nullable String sName)
      Check if this resource provider can handle the resource with the passed name. If there is no real check on whether your resource provider can handle it, simply return true.
      Specified by:
      supportsReading in interface IReadableResourceProvider
      Parameters:
      sName - The name to check. May be null.
      Returns:
      true if the name is not null and can be handled by this provider, false otherwise.
    • getReadableResource

      public IReadableResource getReadableResource(@NonNull String sURL)
      Get the resource specified by the given name for reading.
      Specified by:
      getReadableResource in interface IReadableResourceProvider
      Parameters:
      sURL - The name of the resource to resolve.
      Returns:
      The readable resource. Never null.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object