test_class.declarator: URL_STRING = "http://testurl"
test_class.modifier: static final
test_class.original_string: static final String URL_STRING = "http://testurl";
test_class.type: String
test_class.var_name: URL_STRING
test_class.declarator: collectServerClient
test_class.original_string: CollectServerClient collectServerClient;
test_class.type: CollectServerClient
test_class.var_name: collectServerClient
test_class.declarator: collectServerClientError
test_class.original_string: CollectServerClient collectServerClientError;
test_class.type: CollectServerClient
test_class.var_name: collectServerClientError
test_class.file: collect_app/src/test/java/org/odk/collect/android/http/CollectServerClientTest.java
test_class.identifier: CollectServerClientTest
test_case.body: @Test
      public void testGetXMLDocument() {
          DocumentFetchResult fetchResult = collectServerClient.getXmlDocument(URL_STRING);
          assertNull(fetchResult.errorMessage);
          assertEquals(fetchResult.responseCode, 0);
          assertTrue(fetchResult.isOpenRosaResponse);
      }
test_case.class_method_signature: CollectServerClientTest.testGetXMLDocument()
test_case.full_signature: @Test public void testGetXMLDocument()
test_case.identifier: testGetXMLDocument
test_case.invocations: getXmlDocument assertNull assertEquals assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetXMLDocument()
focal_class.declarator: HTTP_CONTENT_TYPE_TEXT_XML = "text/xml"
focal_class.modifier: public static final
focal_class.original_string: public static final String HTTP_CONTENT_TYPE_TEXT_XML = "text/xml";
focal_class.type: String
focal_class.var_name: HTTP_CONTENT_TYPE_TEXT_XML
focal_class.declarator: httpInterface
focal_class.modifier: protected
focal_class.original_string: protected OpenRosaHttpInterface httpInterface;
focal_class.type: OpenRosaHttpInterface
focal_class.var_name: httpInterface
focal_class.declarator: webCredentialsUtils
focal_class.modifier: private final
focal_class.original_string: private final WebCredentialsUtils webCredentialsUtils;
focal_class.type: WebCredentialsUtils
focal_class.var_name: webCredentialsUtils
focal_class.file: collect_app/src/main/java/org/odk/collect/android/http/CollectServerClient.java
focal_class.identifier: CollectServerClient
focal_class.class_method_signature: CollectServerClient.CollectServerClient(OpenRosaHttpInterface httpInterface, WebCredentialsUtils webCredentialsUtils)
focal_class.full_signature: @Inject public  CollectServerClient(OpenRosaHttpInterface httpInterface, WebCredentialsUtils webCredentialsUtils)
focal_class.identifier: CollectServerClient
focal_class.modifiers: @Inject public
focal_class.parameters: (OpenRosaHttpInterface httpInterface, WebCredentialsUtils webCredentialsUtils)
focal_class.signature:  CollectServerClient(OpenRosaHttpInterface httpInterface, WebCredentialsUtils webCredentialsUtils)
focal_class.class_method_signature: CollectServerClient.getXmlDocument(String urlString)
focal_class.full_signature: public DocumentFetchResult getXmlDocument(String urlString)
focal_class.identifier: getXmlDocument
focal_class.modifiers: public
focal_class.parameters: (String urlString)
focal_class.return: DocumentFetchResult
focal_class.signature: DocumentFetchResult getXmlDocument(String urlString)
focal_class.class_method_signature: CollectServerClient.getHttpInputStream(@NonNull String downloadUrl, @Nullable final String contentType)
focal_class.full_signature: public @NonNull HttpGetResult getHttpInputStream(@NonNull String downloadUrl, @Nullable final String contentType)
focal_class.identifier: getHttpInputStream
focal_class.modifiers: public @NonNull
focal_class.parameters: (@NonNull String downloadUrl, @Nullable final String contentType)
focal_class.return: HttpGetResult
focal_class.signature: HttpGetResult getHttpInputStream(@NonNull String downloadUrl, @Nullable final String contentType)
focal_class.class_method_signature: CollectServerClient.getPlainTextMimeType()
focal_class.full_signature: public static String getPlainTextMimeType()
focal_class.identifier: getPlainTextMimeType
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getPlainTextMimeType()
focal_method.body: public DocumentFetchResult getXmlDocument(String urlString) {
  
          // parse response
          Document doc;
          HttpGetResult inputStreamResult;
  
          try {
              inputStreamResult = getHttpInputStream(urlString, HTTP_CONTENT_TYPE_TEXT_XML);
  
              if (inputStreamResult.getStatusCode() != HttpURLConnection.HTTP_OK) {
                  String error = "getXmlDocument failed while accessing "
                          + urlString + " with status code: " + inputStreamResult.getStatusCode();
                  Timber.e(error);
                  return new DocumentFetchResult(error, inputStreamResult.getStatusCode());
              }
  
              try (InputStream resultInputStream = inputStreamResult.getInputStream();
                   InputStreamReader streamReader = new InputStreamReader(resultInputStream, "UTF-8")) {
  
                  doc = new Document();
                  KXmlParser parser = new KXmlParser();
                  parser.setInput(streamReader);
                  parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
                  doc.parse(parser);
              }
          } catch (Exception e) {
              String error = "Parsing failed with " + e.getMessage() + " while accessing " + urlString;
              Timber.e(error);
              return new DocumentFetchResult(error, 0);
          }
  
          return new DocumentFetchResult(doc, inputStreamResult.isOpenRosaResponse(), inputStreamResult.getHash());
      }
focal_method.class_method_signature: CollectServerClient.getXmlDocument(String urlString)
focal_method.full_signature: public DocumentFetchResult getXmlDocument(String urlString)
focal_method.identifier: getXmlDocument
focal_method.invocations: getHttpInputStream getStatusCode getStatusCode e getStatusCode getInputStream setInput setFeature parse getMessage e isOpenRosaResponse getHash
focal_method.modifiers: public
focal_method.parameters: (String urlString)
focal_method.return: DocumentFetchResult
focal_method.signature: DocumentFetchResult getXmlDocument(String urlString)