- private static String safeName(ReadGraph graph, Resource value) throws DatabaseException {
- return graph.syncRequest(new NameRequest(value));
- }
-
- public static class NameRequest extends ResourceRead<String> {
- public NameRequest(Resource resource) {
- super(resource);
- }
- @Override
- public String perform(ReadGraph graph) throws DatabaseException {
- try {
- return graph.adapt(resource, String.class);
- } catch (AdaptionException e) {
- return NameUtils.getSafeName(graph, resource);
- }
- }
- }
-