Class PartheosRegistryResolver
- java.lang.Object
-
- org.gcube.datatransfer.resolver.services.PartheosRegistryResolver
-
@Path("parthenos_registry") public class PartheosRegistryResolver extends ObjectThe 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 Summary
Constructors Constructor Description PartheosRegistryResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.ResponsepostCatalogue(javax.servlet.http.HttpServletRequest req, ParthenosRequest jsonRequest)To get a normalized item name from a Parthenos URL.javax.ws.rs.core.ResponseresolveParthenosURL(javax.servlet.http.HttpServletRequest req, String provider, String path, String remainPath)Resolve parthenos url.protected StringtoNameForCatalogue(String remainPathParthenosURL)To name for catalogue.
-
-
-
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.WebApplicationExceptionResolve parthenos url. To resolve an "item" from a Parthenos URL stored in the Parthenos Catalogue at https://ckan-parthenos.d4science.org/- Parameters:
req- the reqprovider- the providerpath- the pathremainPath- 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.WebApplicationExceptionTo 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 reqjsonRequest- the json request- Returns:
- the response
- Throws:
Exception- the exceptionjavax.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
-
-