Interface ResourceSource

All Superinterfaces:
Savable
All Known Implementing Classes:
StringResourceSource, URLResourceSource

public interface ResourceSource extends Savable
Represents a named resource
  • Field Details

  • Method Details

    • getName

      String getName()
      Returns:
      the name of this resource.
    • getType

      String getType()
      Returns:
      the "type" of resource we are pointing to. For example ".jpg", ".dae", etc.
    • getRelativeSource

      ResourceSource getRelativeSource(String name)
      Generate and return a new ResourceSource pointing to a named resource that is relative to this object's resource.
      Parameters:
      name - the name of the resource we want. eg. "./mypic.jpg" etc.
      Returns:
      the relative resource, or null if none is found. Will also return null if this ResourceSource type does not support relative source.
    • openStream

      InputStream openStream() throws IOException
      Returns:
      an InputStream to this resource's contents.
      Throws:
      IOException - if something wrong occurs while reading