@Override public List<URI> getChildren(URI resource) { try (final FcrepoResponse response = client.get(resource) .accept("application/n-triples") .preferRepresentation(asList(PREFER_CONTAINMENT), emptyList()).perform()) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(response.getBody(), UTF_8))) { final List<URI> children = new ArrayList<>(); for (String line = reader.readLine(); line != null; line = reader.readLine()) { final Matcher aclFinder = childPattern.matcher(line); if (aclFinder.matches()) { children.add(URI.create(aclFinder.group(1))); } } return children; } } catch (final Exception e) { throw new RuntimeException("Error getting children of " + resource, e); } } }
@Override public List<URI> getChildren(URI resource) { try (final FcrepoResponse response = client.get(resource) .accept("application/n-triples") .preferRepresentation(asList(PREFER_CONTAINMENT), emptyList()).perform()) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(response.getBody(), UTF_8))) { final List<URI> children = new ArrayList<>(); for (String line = reader.readLine(); line != null; line = reader.readLine()) { final Matcher aclFinder = childPattern.matcher(line); if (aclFinder.matches()) { children.add(URI.create(aclFinder.group(1))); } } return children; } } catch (final Exception e) { throw new RuntimeException("Error getting children of " + resource, e); } } }
.accept(COMPACTED_ACCEPTTYPE) .preferRepresentation(include, omits) .perform()) {
.accept(COMPACTED_ACCEPTTYPE) .preferRepresentation(include, omits) .perform()) {
.accept(COMPACTED_ACCEPTTYPE) .preferRepresentation(null, omits) .perform()) {
.accept(COMPACTED_ACCEPTTYPE) .preferRepresentation(null, omits) .perform()) {
/** * @param containerURI URI * @return resources * @throws ModellerClientFailedException Throwable */ public static String doGetContainerResources(final URI containerURI) throws ModellerClientFailedException { final FcrepoClient testClient; testClient = FcrepoClient.client().throwExceptionOnFailure().build(); try (FcrepoResponse response = testClient.get(containerURI).accept("text/turtle").perform()) { return IOUtils.toString(response.getBody(), "UTF-8"); } catch (FcrepoOperationFailedException e) { log.info(getMessage(e)); throw new ModellerClientFailedException(e); } catch (IOException e) { e.printStackTrace(); } return null; } }
final FcrepoPrefer prefer = new FcrepoPrefer(preferHeader); if (prefer.isMinimal()) { response = get.preferMinimal().perform(); } else if (prefer.isRepresentation()) { response = get.preferRepresentation(prefer.getInclude(), prefer.getOmit()).perform(); } else { response = get.perform(); final List<URI> omit = getPreferOmit(endpoint); if (include.isEmpty() && omit.isEmpty()) { response = get.perform(); } else { response = get.preferRepresentation(include, omit).perform();