Class Resource

  • All Implemented Interfaces:
    java.io.Serializable

    public class Resource
    extends java.lang.Object
    implements java.io.Serializable
    Resource definition
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Resource​(java.lang.String id, java.lang.String code, java.lang.String type, byte[] data, boolean cached)
      Resource from a content
      Resource​(java.lang.String id, java.lang.String code, java.lang.String type, java.lang.String docId, boolean cached)
      Resource from a document
    • Method Summary

      Modifier and Type Method Description
      void addResource​(Resource r)  
      void clearCache()  
      byte[] getBytes()
      Get resource data (no doc)
      boolean getCached()
      Get resource cached flag
      java.lang.String getCode()
      Get resource code
      java.lang.String getDocId()
      Get resource document ID
      DocumentDB getDocument​(Grant g)
      Get resource document
      byte[] getDocumentContent​(Grant g)
      Get resource document content
      java.lang.String getId()
      Get resource ID
      java.util.List<Resource> getResources()
      The resource is a set of resources (icons set)
      java.lang.String getType()
      Get resource type
      void setBytes​(byte[] data)
      Set resource data (no doc)
      void setCached​(boolean c)
      Set resource cached flag
      void setCode​(java.lang.String c)
      Set resource code
      void setDocId​(java.lang.String d)
      Set resource document ID
      void setId​(java.lang.String i)
      Set resource ID
      void setType​(java.lang.String t)
      Set resource type
      java.lang.String toJSON()
      Resource as JSON string
      org.json.JSONObject toJSONObject()
      Resource as JSON object
      java.lang.String toString()
      Same as toJSON
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Resource

        public Resource​(java.lang.String id,
                        java.lang.String code,
                        java.lang.String type,
                        java.lang.String docId,
                        boolean cached)
        Resource from a document
      • Resource

        public Resource​(java.lang.String id,
                        java.lang.String code,
                        java.lang.String type,
                        byte[] data,
                        boolean cached)
        Resource from a content
    • Method Detail

      • setId

        public void setId​(java.lang.String i)
        Set resource ID
      • getId

        public java.lang.String getId()
        Get resource ID
      • setCode

        public void setCode​(java.lang.String c)
        Set resource code
      • getCode

        public java.lang.String getCode()
        Get resource code
      • setType

        public void setType​(java.lang.String t)
        Set resource type
      • getType

        public java.lang.String getType()
        Get resource type
      • setDocId

        public void setDocId​(java.lang.String d)
        Set resource document ID
      • getDocId

        public java.lang.String getDocId()
        Get resource document ID
      • setCached

        public void setCached​(boolean c)
        Set resource cached flag
      • getCached

        public boolean getCached()
        Get resource cached flag
      • getBytes

        public byte[] getBytes()
        Get resource data (no doc)
      • setBytes

        public void setBytes​(byte[] data)
        Set resource data (no doc)
      • getResources

        public java.util.List<Resource> getResources()
        The resource is a set of resources (icons set)
      • addResource

        public void addResource​(Resource r)
      • clearCache

        public void clearCache()
      • getDocument

        public DocumentDB getDocument​(Grant g)
        Get resource document
        Parameters:
        g - Grant
      • getDocumentContent

        public byte[] getDocumentContent​(Grant g)
        Get resource document content
        Parameters:
        g - Grant
      • toJSONObject

        public org.json.JSONObject toJSONObject()
        Resource as JSON object
      • toJSON

        public java.lang.String toJSON()
        Resource as JSON string
      • toString

        public java.lang.String toString()
        Same as toJSON
        Overrides:
        toString in class java.lang.Object