Class JsonRepository

  • All Implemented Interfaces:
    org.osgi.service.repository.Repository

    public class JsonRepository
    extends BaseRepository
    Repository using a JSON representation of resource metadata. The json should be a map: the key is the resource uri and the value is a map of resource headers. The content of the URL can be gzipped.
    • Field Summary

      • Fields inherited from interface org.osgi.service.repository.Repository

        URL
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonRepository​(java.lang.String url, long expiration)  
    • Constructor Detail

      • JsonRepository

        public JsonRepository​(java.lang.String url,
                              long expiration)
    • Method Detail

      • getResources

        public java.util.List<org.osgi.resource.Resource> getResources()
        Overrides:
        getResources in class BaseRepository
      • findProviders

        public java.util.Map<org.osgi.resource.Requirement,​java.util.Collection<org.osgi.resource.Capability>> findProviders​(java.util.Collection<? extends org.osgi.resource.Requirement> requirements)
        Specified by:
        findProviders in interface org.osgi.service.repository.Repository
        Overrides:
        findProviders in class BaseRepository
      • checkAndLoadCache

        protected void checkAndLoadCache()
      • doRead

        protected boolean doRead​(java.io.InputStream is)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • buildResource

        protected void buildResource​(java.lang.String uri,
                                     java.util.Map<java.lang.String,​java.lang.String> headerMap)
                              throws java.io.IOException
        Throws:
        java.io.IOException