Class URLResource


  • public class URLResource
    extends Resource
    Child class of Resource. A class representing a resource (file) located on a URL.
    • Constructor Summary

      Constructors 
      Constructor Description
      URLResource​(java.lang.String URL, java.lang.String filetype, java.lang.String mimeType)
      Constructor for this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.gson.JsonObject getJSONForSecondaryFile()
      Needs to be used to get the JSON of a resource for a secondary file (file to prepend, to append, to insert or subtemplate), because their JSON has a different format then for a template.
      com.google.gson.JsonObject getJSONForTemplate()
      Needs to be called to get the JSON of a resource for a template.
      java.lang.String getURL()  
      void setURL​(java.lang.String URL)
      Sets the URL of the resource to given URL.
      • Methods inherited from class java.lang.Object

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

      • URLResource

        public URLResource​(java.lang.String URL,
                           java.lang.String filetype,
                           java.lang.String mimeType)
        Constructor for this class. For a URL resource you have to specify the filetype (extension) and mimetype because it can't be deduced.
        Parameters:
        URL - of the resource
        filetype - extension of the resource
        mimeType - of the resource
    • Method Detail

      • getURL

        public java.lang.String getURL()
        Returns:
        URL of the resource.
      • setURL

        public void setURL​(java.lang.String URL)
        Sets the URL of the resource to given URL.
        Parameters:
        URL - of the resource.
      • getJSONForTemplate

        public com.google.gson.JsonObject getJSONForTemplate()
        Description copied from class: Resource
        Needs to be called to get the JSON of a resource for a template.
        Specified by:
        getJSONForTemplate in class Resource
        Returns:
        JSONObject with the tags for a URL resource as template for the Cloud Office Print server ("url","template_type").
      • getJSONForSecondaryFile

        public com.google.gson.JsonObject getJSONForSecondaryFile()
        Description copied from class: Resource
        Needs to be used to get the JSON of a resource for a secondary file (file to prepend, to append, to insert or subtemplate), because their JSON has a different format then for a template.
        Specified by:
        getJSONForSecondaryFile in class Resource
        Returns:
        JSONObject with the tags ("mime_type","file_url","file_source") for a URL resource as a secondary file (subtemplates, files to prepend, files to append and files to insert) for the Cloud Office Print server.