Class PartheosRegistryResolver


  • @Path("parthenos_registry")
    public class PartheosRegistryResolver
    extends Object
    The PartheosRegistryResolver. See more at https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#Parthenos_URL_Resolver
    Author:
    Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Nov 16, 2018
    • Constructor Detail

      • PartheosRegistryResolver

        public PartheosRegistryResolver()
    • Method Detail

      • resolveParthenosURL

        @GET
        @Path("/{provider}/{path}{remainPath:(/[^?$]+)?}")
        public javax.ws.rs.core.Response resolveParthenosURL​(@Context
                                                             javax.servlet.http.HttpServletRequest req,
                                                             @PathParam("provider")
                                                             String provider,
                                                             @PathParam("path")
                                                             String path,
                                                             @PathParam("remainPath")
                                                             String remainPath)
                                                      throws javax.ws.rs.WebApplicationException
        Resolve parthenos url. To resolve an "item" from a Parthenos URL stored in the Parthenos Catalogue at https://ckan-parthenos.d4science.org/
        Parameters:
        req - the req
        provider - the provider
        path - the path
        remainPath - the remain path
        Returns:
        the response
        Throws:
        javax.ws.rs.WebApplicationException
      • postCatalogue

        @POST
        @Path("")
        @Consumes("application/json")
        @Produces("text/plain")
        public javax.ws.rs.core.Response postCatalogue​(@Context
                                                       javax.servlet.http.HttpServletRequest req,
                                                       ParthenosRequest jsonRequest)
                                                throws javax.ws.rs.WebApplicationException
        To get a normalized item name from a Parthenos URL. It applies a normalization function to get from an input Parthenos URL an item name that is catalogue compliant.
        Parameters:
        req - the req
        jsonRequest - the json request
        Returns:
        the response
        Throws:
        Exception - the exception
        javax.ws.rs.WebApplicationException
      • toNameForCatalogue

        protected String toNameForCatalogue​(String remainPathParthenosURL)
                                     throws UnsupportedEncodingException
        To name for catalogue. this method applyes a fuction to transform a parthenos URL to acceptable catalogue name (that is URL)
        Parameters:
        remainPathParthenosURL - the remain path parthenos url
        Returns:
        the string
        Throws:
        UnsupportedEncodingException - the unsupported encoding exception