public List < JSONObject > getResourceData ( ) { List < JSONObject > resources = new ArrayList < JSONObject > ( ) ; try { if ( data != null && data . has ( documentsParam ) ) { List < JSONObject > results = getDocuments ( ) ; for ( JSONObject json : results ) { if ( json . has ( documentParam ) ) { JSONObject result = json . getJSONObject ( documentParam ) ; results . add ( result ) ; } } } else if ( data != null && data . has ( getRecordParam ) ) { List < JSONObject > results = getRecords ( ) ; for ( JSONObject json : results ) { if ( json . has ( resourceDataParam ) ) { JSONObject result = json . getJSONObject ( resourceDataParam ) ; results . add ( result ) ; } } } } catch ( JSONException e ) { //This is already handled by the enclosing "has" checks } return resources ; }
Returns resource data from obtain or harvest request