title: Retrieve data from method in java
body: <p>How can I retrieve a file from the following method:</p>
  
  <pre><code>public void getJson(String pathToFile) {
      String userUrl = DOMAIN_URL+pathToFile;
      RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode(userUrl));
      JSONArray outerJsonArray;
      try {
          Request request = builder.sendRequest(null, new RequestCallback() {
              public void onError(Request request, Throwable exception) {
  
              }
              public void onResponseReceived(Request request, Response response) {
                  if (200 == response.getStatusCode()) {
                      try {
                          JSONValue jsonValue = JSONParser.parse(response.getText());
                          JSONArray jsonArray = jsonValue.isArray();
                          if (jsonArray != null) {
  
                          } else {
                              throw new JSONException();
                          }
                      } catch (JSONException e) {
  
                      }
                  } else {
  
                  }
              }
          });
      } catch (RequestException e) {
  
      }
  }
  </code></pre>
  
  <p>Now it is just void. I should retriwe the jsonArray variable</p>