Updated copyright
[pithos-web-client] / src / gr / grnet / pithos / web / client / rest / HeadRequest.java
index b26f450..cb3f41a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 GRNET S.A. All rights reserved.
+ * Copyright 2011-2012 GRNET S.A. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or
  * without modification, are permitted provided that the following
@@ -88,8 +88,11 @@ public abstract class HeadRequest<T extends Resource> implements ScheduledComman
 
     @Override
     public void execute() {
+       if (path.contains("?"))
+               path += "&t=" + System.currentTimeMillis();
+       else
+               path += "?t=" + System.currentTimeMillis();
         RequestBuilder builder = new RequestBuilder(RequestBuilder.HEAD, api + owner + path);
-        builder.setHeader("If-Modified-Since", "0");
         for (String header : headers.keySet()) {
             builder.setHeader(header, headers.get(header));
         }
@@ -106,7 +109,7 @@ public abstract class HeadRequest<T extends Resource> implements ScheduledComman
                 }
 
                 @Override
-                public void onError(@SuppressWarnings("unused") Request request, Throwable throwable) {
+                public void onError(Request request, Throwable throwable) {
                     if (throwable instanceof RestException) {
                         if (((RestException) throwable).getHttpStatusCode() == 304 && cached != null){
                             GWT.log("Using cache: " + cached.toString(), null);