public static String readMockResponse(Context context, String filePath) {

    String responseString;
    try {
      responseString = IOUtils.readFileFromAssets(context, filePath);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    if (TextUtils.isEmpty(responseString)) {
      throw new RuntimeException("Mock file \"" + filePath + "\" is empty");
    }

    return responseString;
  }
public static String readMockResponse ( Context context , String filePath ) { String responseString ; try { responseString = IOUtils . readFileFromAssets ( context , filePath ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } if ( TextUtils . isEmpty ( responseString ) ) { throw new RuntimeException ( "Mock file \"" + filePath + "\" is empty" ) ; } return responseString ; }
Reads mock response string from given path.

@param context  Context with file access
@param filePath Path to mock file
@return Response string