Class AliasedNamedResource

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

public class AliasedNamedResource
extends java.lang.Object
implements Resource
A Resource wrapper with a custom name
  • Constructor Summary

    Constructors
    Constructor Description
    AliasedNamedResource​(Resource resource, java.lang.String resourceName)
    Constructor
  • Method Summary

    Modifier and Type Method Description
    java.util.stream.Stream<java.lang.String> getAllLocations()
    Get all the locations for this resource.
    java.lang.String getName()
    Get the name of this resource
    java.net.URL getResource​(java.lang.String location)
    Get the resource.
    java.io.InputStream getResourceAsStream​(java.lang.String location)
    Get the resource as a stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AliasedNamedResource

      public AliasedNamedResource​(Resource resource, java.lang.String resourceName)
      Constructor
      Parameters:
      resource - the resource
      resourceName - the resource name
  • Method Details

    • getResource

      public java.net.URL getResource​(java.lang.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 java.io.InputStream getResourceAsStream​(java.lang.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 java.util.stream.Stream<java.lang.String> getAllLocations()
      Description copied from interface: Resource
      Get all the locations for this resource.
      Specified by:
      getAllLocations in interface Resource
      Returns:
      all the locations for this resource.
    • getName

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