Cleanup and bugfix pairing code.

This commit is contained in:
Cameron Gutman
2014-06-15 18:54:32 -07:00
parent 07cf96c5ce
commit 6a92ea74fc
3 changed files with 38 additions and 28 deletions
@@ -28,6 +28,8 @@ public class NvHTTP {
public static final int PORT = 47984;
public static final int CONNECTION_TIMEOUT = 5000;
private final boolean verbose = false;
public String baseUrl;
@@ -96,7 +98,9 @@ public class NvHTTP {
private InputStream openHttpConnection(String url) throws IOException {
URLConnection conn = new URL(url).openConnection();
System.out.println(conn.getURL());
if (verbose) {
System.out.println(url);
}
conn.setConnectTimeout(CONNECTION_TIMEOUT);
conn.setUseCaches(false);
conn.connect();
@@ -112,7 +116,11 @@ public class NvHTTP {
}
s.close();
System.out.println(str);
if (verbose) {
System.out.println(str);
}
return str;
}