/** * Check if the given resource has a <code>name</code> subresource, and return its value, * if present. Otherwise, the resource path (location) is returned. * @param resource */ public static String getHumanReadableName(Resource resource) { final String name = getNameResourceValue(resource); return name != null ? name : resource.getLocation(); }
/**Like getHumanReadableName, but just return Resource.getName when no other name is specified*/ public static String getHumanReadableShortName(Resource resource) { final String name = getNameResourceValue(resource); return name != null ? name : resource.getName(); }