|
@@ -160,20 +160,17 @@ public class Get extends Task { |
|
|
if (connection instanceof HttpURLConnection) { |
|
|
if (connection instanceof HttpURLConnection) { |
|
|
HttpURLConnection httpConnection |
|
|
HttpURLConnection httpConnection |
|
|
= (HttpURLConnection) connection; |
|
|
= (HttpURLConnection) connection; |
|
|
|
|
|
long lastModified = httpConnection.getLastModified(); |
|
|
if (httpConnection.getResponseCode() |
|
|
if (httpConnection.getResponseCode() |
|
|
== HttpURLConnection.HTTP_NOT_MODIFIED |
|
|
== HttpURLConnection.HTTP_NOT_MODIFIED |
|
|
//workaround: doesn't work on 1.2 |
|
|
|
|
|
|| (hasTimestamp |
|
|
|
|
|
&& JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) |
|
|
|
|
|
&& timestamp > httpConnection.getLastModified())) { |
|
|
|
|
|
|
|
|
|| (lastModified != 0 && hasTimestamp |
|
|
|
|
|
&& timestamp > lastModified)) { |
|
|
//not modified so no file download. just return |
|
|
//not modified so no file download. just return |
|
|
//instead and trace out something so the user |
|
|
//instead and trace out something so the user |
|
|
//doesn't think that the download happened when it |
|
|
//doesn't think that the download happened when it |
|
|
//didn't |
|
|
//didn't |
|
|
log("Not modified - so not downloaded", logLevel); |
|
|
log("Not modified - so not downloaded", logLevel); |
|
|
return false; |
|
|
return false; |
|
|
// also, if timestamp is roughly >= now, HTTP_NOT_MODIFIED is _not_ |
|
|
|
|
|
// returned... We may want to remove the 1.2 qualifier above. |
|
|
|
|
|
} |
|
|
} |
|
|
// test for 401 result (HTTP only) |
|
|
// test for 401 result (HTTP only) |
|
|
if (httpConnection.getResponseCode() |
|
|
if (httpConnection.getResponseCode() |
|
|