You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Jonathan Bayle <jo...@gael.fr> on 2015/04/22 14:26:56 UTC
Olingo2 use a UriParser client side
Dear list,
I'm writing an OData client using Olingo 2, this client has discovery
capabilities: I retrieve the EDM and then I have to parse and analyse
the URI with the EDM to figure out what the URI is addressing exactly.
That task is already implemented in Olingo and is accessible
(RuntimeDelegate.getUriParser(Edm)) but it requires instances of
PathSegment to work (UriParser.parse(List<PathSegment>)) and PathSegment
has no public implementation.
How can I use the UriParser client side ?
Thanks,
Jonathan.
Re: Olingo2 use a UriParser client side
Posted by "Bolz, Michael" <mi...@sap.com>.
Hi Jonathan,
actual this looks to be a missing part in the API for UriParser.
A simple workaround would be to use an own implementation e.g. as inner class:
private PathSegment getPathSegment(final String path) {
final PathSegment pathSegment = new PathSegment() {
@Override
public String getPath() {
return path;
}
@Override
public Map<String, List<String>> getMatrixParameters() {
return Collections.emptyMap();
}
};
return pathSegment;
}
However you could create an according issue in JIRA (https://issues.apache.org/jira/browse/OLINGO <https://issues.apache.org/jira/browse/OLINGO>)
and afterwards we can discuss about a solution (e.g. add a “factory method” in UriParser).
Best regards,
Michael
> On 22 Apr 2015, at 14:26, Jonathan Bayle <jo...@gael.fr> wrote:
>
> Dear list,
>
> I'm writing an OData client using Olingo 2, this client has discovery capabilities: I retrieve the EDM and then I have to parse and analyse the URI with the EDM to figure out what the URI is addressing exactly.
>
> That task is already implemented in Olingo and is accessible (RuntimeDelegate.getUriParser(Edm)) but it requires instances of PathSegment to work (UriParser.parse(List<PathSegment>)) and PathSegment has no public implementation.
>
> How can I use the UriParser client side ?
>
> Thanks,
> Jonathan.