Class ClassResource

java.lang.Object
cloud.piranha.resource.impl.ClassResource
All Implemented Interfaces:
Resource

public class ClassResource extends Object implements Resource
A resource backed by a class.
Author:
Manfred Riem ([email protected])
  • Constructor Details

    • ClassResource

      public ClassResource(String className)
      Constructor.
      Parameters:
      className - the class name.
  • Method Details

    • getResource

      public URL getResource(String location)
      Description copied from interface: Resource
      Get the resource.
      Specified by:
      getResource in interface Resource
      Parameters:
      location - the location.
      Returns:
      the URL.
    • getResourceAsStream

      public InputStream getResourceAsStream(String location)
      Description copied from interface: Resource
      Get the resource as a stream.
      Specified by:
      getResourceAsStream in interface Resource
      Parameters:
      location - the location.
      Returns:
      the resource as a stream, or null if not found.
    • getAllLocations

      public Stream<String> getAllLocations()
      Description copied from interface: Resource
      Returns all the locations for this resource.
      Specified by:
      getAllLocations in interface Resource
      Returns:
      all the locations for this resource
    • getName

      public String getName()
      Description copied from interface: Resource
      Get the name of this resource
      Specified by:
      getName in interface Resource
      Returns:
      the name
    • toString

      public String toString()
      Overrides:
      toString in class Object