|
From: <tre...@us...> - 2007-09-19 20:32:48
|
Revision: 427
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=427&view=rev
Author: trevorolio
Date: 2007-09-19 13:32:50 -0700 (Wed, 19 Sep 2007)
Log Message:
-----------
Retweaked the client api wire so that all JRE 1.6+ clients don't use the applet cache, which is broken in 1.6u1 on.
Removed the domain from the cookies so that hosts within the same domain can have different account records, which is handy for when you want public.example.com and seekret.example.com.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java 2007-09-18 22:45:40 UTC (rev 426)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java 2007-09-19 20:32:50 UTC (rev 427)
@@ -19,9 +19,10 @@
public class WebAPIClientWire {
- private boolean printedCacheComplaint = false;
- private static final String BAD_SUN_VERSION = "1.6;";
-
+ private boolean printedCacheComplaint = false;
+
+ private static final String BAD_SUN_VERSION = "1.6"; //don't add a semicolon on the end of this, as we want to match all 1.6x jvms
+
public InputStream performPUT(URI uri, InputStream input, String type, int length, String authCookie) throws IOException {
HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection();
connection.setRequestMethod("PUT");
@@ -156,7 +157,7 @@
Log.warn("Not using Sun's download cache, which they broke in Java 1.6u1.");
}
} catch (URISyntaxException e) {
- Log.error("Tried to reset the URI to avoid bad cache in 1.6",e);
+ Log.error("Tried to reset the URI to avoid bad cache in 1.6", e);
}
}
@@ -227,7 +228,7 @@
Log.warn("Not using Sun's download cache, which they broke in Java 1.6u1.");
}
} catch (URISyntaxException e) {
- Log.error("Tried to reset the URI to avoid bad cache in 1.6",e);
+ Log.error("Tried to reset the URI to avoid bad cache in 1.6", e);
}
}
@@ -295,17 +296,17 @@
// XXX seems to be required
String headerValue = null;
Object makeLinuxHappy = (connection.getRequestProperties().get(headerName));
- if (makeLinuxHappy!=null) {
- if (makeLinuxHappy instanceof String) {
- headerValue = (String) makeLinuxHappy;
- } else if (makeLinuxHappy instanceof List) {
- headerValue = (String) ((List) makeLinuxHappy).get(0);
- } else {
- // we don't understand this type at all
- Log.error("Unable to understand the type returned by Linux workaround in WebAPIClient:"+makeLinuxHappy.getClass().getName());
- return null;
- }
- }
+ if (makeLinuxHappy != null) {
+ if (makeLinuxHappy instanceof String) {
+ headerValue = (String) makeLinuxHappy;
+ } else if (makeLinuxHappy instanceof List) {
+ headerValue = (String) ((List) makeLinuxHappy).get(0);
+ } else {
+ // we don't understand this type at all
+ Log.error("Unable to understand the type returned by Linux workaround in WebAPIClient:" + makeLinuxHappy.getClass().getName());
+ return null;
+ }
+ }
if (makeLinuxHappy == null) {
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|