Class WebResources

java.lang.Object
se.conciliate.extensions.publish.WebResources

public class WebResources extends Object
Author:
Per-Erik
  • Constructor Details

    • WebResources

      public WebResources()
  • Method Details

    • addSource

      public WebResources addSource(Path resourcePath, URL resource) throws IllegalArgumentException
      Adds the resource 'resource' with the relative path 'resourcePath' to the resources. The final path to the source as seen from the index file is not known during publishing. Once the publish is complete an ECMAScript can look at the variable MT.pages to get the (relative) root of the resource. The resource will then be available at {MT.pages}/{resourcePath}. That is, the path to the resource can be found with the ECMAScript code: var path = MT.pages + "/" + resourcePath; Where resourcePath is the path given to this method.
      Parameters:
      resourcePath - The relative path that gives a way to locate the resource from the published material. Which path to resolve against is up to the implementation. All that is needed is for the resource to be accessible from pages-{unknown_string}/resourcePath once the resource hits the browser.
      resource - A url locating the resource.
      Returns:
      The resulting resources.
      Throws:
      IllegalArgumentException - if resourcePath is absolute.
    • addSource

      public WebResources addSource(Path resourcePath, byte[] data)
    • addSources

      public WebResources addSources(WebResources other)
    • getResourcePaths

      public Set<Path> getResourcePaths()
    • getResourceContent

      public InputStream getResourceContent(Path sourceName) throws IOException
      Throws:
      IOException
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object