Parse the status code integer out of the response.
M src/main/java/com/ajtjp/geminiclient/GeminiClient.java +1 -1
@@ 45,7 45,7 @@ public class GeminiClient {
         os.flush();
         
         InputStream is = s.getInputStream();
-        doc.headers = parseHeaders(is);
+        doc.setHeaders(parseHeaders(is));
         
         StringBuilder sb = new StringBuilder();
         byte[] buffer = new byte[2000];

          
M src/main/java/com/ajtjp/geminiclient/GeminiDocument.java +16 -0
@@ 7,6 7,7 @@ import java.util.List;
 public class GeminiDocument {
     String documentURL;
     String headers; //eventually, will parse this out more semantically
+    int statusCode;
     
     List<GeminiLine> lines;
     

          
@@ 26,4 27,19 @@ public class GeminiDocument {
     public String getURL() {
         return documentURL;
     }
+    
+    public int getStatusCode() {
+        return statusCode;
+    }
+    
+    public void setHeaders(String headers) {
+        this.headers = headers;
+        try {
+            statusCode = Integer.parseInt(headers.substring(0, 2));
+        }
+        catch(NumberFormatException ex) {
+            statusCode = 50;
+        }
+        
+    }
 }