+ @Override
+ public int getResponseCode() throws IOException {
+ /*
+ * We're got the response code already
+ */
+ if (responseCode != -1) {
+ return responseCode;
+ }
+
+ /*
+ * Ensure that we have connected to the server. Record
+ * exception as we need to re-throw it if there isn't
+ * a status line.
+ */
+ Exception exc = null;
+ try {
+ BufferedInputStream is = (BufferedInputStream) getInputStream();
+ if (is.available() > 40)
+ return responseCode = HTTP_OK;
+ is.mark(15);
+ byte[] bytes = new byte[13];
+ is.read(bytes);
+ is.reset();
+ String s = new String(bytes);
+ if (s.startsWith("Network Error"))
+ return responseCode = HTTP_NOT_FOUND;
+ } catch (Exception e) {
+ exc = e;
+ }
+ return responseCode = HTTP_INTERNAL_ERROR;
+ }
+@Override
+public void disconnect() {
+ // TODO Auto-generated method stub
+
+}
+
+@Override
+public boolean usingProxy() {
+ // TODO Auto-generated method stub
+ return false;
+}
+