/** * Get a web target pointing to the base URL. * @return the web target */ default WebTarget target() { return target(getBaseURL()); }
/** * Get a web target pointing to the provided URL. * @param url the URL * @return the web target */ default WebTarget target(final String url) { return getClient().target(url); }
/** * Get the EntityTag for a given resource. * @param url the URL * @return the entity tag */ default EntityTag getETag(final String url) { try (final Response res = target(url).request().get()) { return res.getEntityTag(); } }
/** * Get the EntityTag for a given resource. * @param url the URL * @return the entity tag */ default EntityTag getETag(final String url) { try (final Response res = target(url).request().get()) { return res.getEntityTag(); } }
/** * Get a web target pointing to the base URL. * @return the web target */ default WebTarget target() { return target(getBaseURL()); }
/** * Get the describedby Link value, if one exists. * @param url the URL * @return the location of a description resource, or null if none is available */ default String getDescription(final String url) { try (final Response res = target(url).request().head()) { return getLinks(res).stream().filter(link -> "describedby".equals(link.getRel())) .map(Link::getUri).map(URI::toString).findFirst().orElse(null); } }
/** * Get a web target pointing to the provided URL. * @param url the URL * @return the web target */ default WebTarget target(final String url) { return getClient().target(url); }
/** * Get the describedby Link value, if one exists. * @param url the URL * @return the location of a description resource, or null if none is available */ default String getDescription(final String url) { try (final Response res = target(url).request().head()) { return getLinks(res).stream().filter(link -> "describedby".equals(link.getRel())) .map(Link::getUri).map(URI::toString).findFirst().orElse(null); } }