private JSONObject listIndexesOfflineSync ( ) throws AlgoliaException { try { final String rootDataPath = getRootDataDir ( ) . getAbsolutePath ( ) ; final File appDir = getAppDir ( ) ; final File [ ] directories = appDir . listFiles ( new FileFilter ( ) { @ Override public boolean accept ( File pathname ) { return pathname . isDirectory ( ) ; } } ) ; JSONObject response = new JSONObject ( ) ; JSONArray items = new JSONArray ( ) ; if ( directories != null ) { for ( File directory : directories ) { final String name = directory . getName ( ) ; if ( hasOfflineData ( name ) ) { items . put ( new JSONObject ( ) . put ( "name" , name ) ) ; // TODO: Do we need other data as in the online API? } } } response . put ( "items" , items ) ; return response ; } catch ( JSONException e ) { throw new RuntimeException ( e ) ; // should never happen } }
List existing offline indices .