Search in sources :

Example 1 with PathWithVersion

use of com.b2international.snowowl.core.uri.ResourceURIPathResolver.PathWithVersion in project snow-owl by b2ihealthcare.

the class TerminologyResourceContentRequest method execute.

@Override
public R execute(TerminologyResourceContext context) {
    final ResourceURI resourceURI = context.resourceURI();
    final TerminologyResource resource = context.resource();
    final PathWithVersion branchPathWithVersion = context.service(ResourceURIPathResolver.class).resolveWithVersion(context, resourceURI, resource);
    final String path = branchPathWithVersion.getPath();
    final ResourceURI versionResourceURI = branchPathWithVersion.getVersionResourceURI();
    if (versionResourceURI != null) {
        context = context.inject().bind(ResourceURI.class, versionResourceURI).bind(PathWithVersion.class, branchPathWithVersion).build();
    }
    return new RepositoryRequest<R>(resource.getToolingId(), new BranchRequest<R>(path, next())).execute(context);
}
Also used : ResourceURI(com.b2international.snowowl.core.ResourceURI) ResourceURIPathResolver(com.b2international.snowowl.core.uri.ResourceURIPathResolver) TerminologyResource(com.b2international.snowowl.core.TerminologyResource) PathWithVersion(com.b2international.snowowl.core.uri.ResourceURIPathResolver.PathWithVersion) BranchRequest(com.b2international.snowowl.core.request.BranchRequest)

Aggregations

ResourceURI (com.b2international.snowowl.core.ResourceURI)1 TerminologyResource (com.b2international.snowowl.core.TerminologyResource)1 BranchRequest (com.b2international.snowowl.core.request.BranchRequest)1 ResourceURIPathResolver (com.b2international.snowowl.core.uri.ResourceURIPathResolver)1 PathWithVersion (com.b2international.snowowl.core.uri.ResourceURIPathResolver.PathWithVersion)1