@Override public List<File> getSchemas( String mimeType) { // cannot use MapUtil 'all the way' since mimeTypes might include dots. List<File> schemas = new ArrayList<>(); final Map<String, Map<String, Object>> mimeTypeMap = MapUtil.get(this.asMap(), "api.endpoint.consumes"); if (mimeTypeMap != null) { final Map<String, Object> mimeTypeContents = mimeTypeMap.get(mimeType); final List<String> schemaPaths = MapUtil.get(mimeTypeContents, "schemas"); if (schemaPaths != null) { for (String schemaPath : schemaPaths) { schemas.add(new File(getBundleDirectory(), schemaPath)); } } } return schemas; }
@Override public List<String> getMimeTypes() { final Map<String, Object> possibleConsumeMimeTypes = MapUtil.get(this.asMap(), "api.endpoint.consumes"); if (possibleConsumeMimeTypes != null) { return new ArrayList<>(possibleConsumeMimeTypes.keySet()); } else { return new ArrayList<>(); } }