@Test public void testTranslateToGraphUri() throws Exception { URI result = resolver.translateToGraphURI(new URI(annotationUrl)); assertEquals(annotationUrn, result.toString()); }
public URI translateToGraphURI(URI uri) throws AnnotationException { String path = uri.getPath(); if (uri.toString().contains(NUXEO_ANNOTATIONS)) { try { return new URI("urn:annotation:" + path.substring(path.lastIndexOf("/") + 1)); } catch (URISyntaxException e) { throw new AnnotationException(e); } } else { return uri; } }
DefaultUriResolver implements UriResolver { public URI translateToGraphURI(URI uri) throws AnnotationException { String path = uri.getPath(); if (uri.toString().contains(NUXEO_ANNOTATIONS)) { try { return new URI("urn:annotation:" + path.substring(path.lastIndexOf("/") + 1)); } catch (URISyntaxException e) { throw new AnnotationException(e); } } else { return uri; } } }
DefaultUriResolver implements UriResolver { public URI translateToGraphURI(URI uri) throws AnnotationException { String path = uri.getPath(); if (uri.toString().contains(NUXEO_ANNOTATIONS)) { try { return new URI("urn:annotation:" + path.substring(path.lastIndexOf("/") + 1)); } catch (URISyntaxException e) { throw new AnnotationException(e); } } else { return uri; } }  }
DefaultUriResolver implements UriResolver { public URI translateToGraphURI(URI uri) throws AnnotationException { String path = uri.getPath(); if (uri.toString().contains(NUXEO_ANNOTATIONS)) { try { return new URI("urn:annotation:" + path.substring(path.lastIndexOf("/") + 1)); } catch (URISyntaxException e) { throw new AnnotationException(e); } } else { return uri; } }  String getBaseUrl(URI uri); List<URI> getSearchURI(URI uri); URI translateFromGraphURI(URI uri, String baseUrl); URI translateToGraphURI(URI uri); }
DefaultUriResolver implements UriResolver { public URI translateToGraphURI(URI uri) throws AnnotationException { String path = uri.getPath(); if (uri.toString().contains(NUXEO_ANNOTATIONS)) { try { return new URI("urn:annotation:" + path.substring(path.lastIndexOf("/") + 1)); } catch (URISyntaxException e) { throw new AnnotationException(e); } } else { return uri; } }  String getBaseUrl(URI uri); List<URI> getSearchURI(URI uri); URI translateFromGraphURI(URI uri, String baseUrl); URI translateToGraphURI(URI uri);  }