diff --git a/src/main/java/org/javaswift/joss/client/core/AbstractStoredObject.java b/src/main/java/org/javaswift/joss/client/core/AbstractStoredObject.java index fcae344b..31a680ba 100644 --- a/src/main/java/org/javaswift/joss/client/core/AbstractStoredObject.java +++ b/src/main/java/org/javaswift/joss/client/core/AbstractStoredObject.java @@ -1,5 +1,6 @@ package org.javaswift.joss.client.core; +import org.apache.http.Header; import org.javaswift.joss.command.shared.factory.StoredObjectCommandFactory; import org.javaswift.joss.exception.CommandException; import org.javaswift.joss.headers.Metadata; @@ -26,6 +27,8 @@ public abstract class AbstractStoredObject extends AbstractObjectStoreEntity extends AbstractSecureCommand { + private StoredObject object; + public AbstractObjectCommand(Account account, HttpClient httpClient, Access access, StoredObject object) { super(account, httpClient, getURL(access, object), access.getToken()); + this.object = object; + } + + public StoredObject getStoredObject() { + return object; + } + + public void populateResponseHeaders(HttpResponse response) { + object.setResponseHeaders(response.getAllHeaders()); + } + + protected N getReturnObject(HttpResponse response) throws IOException { + populateResponseHeaders(response); + return null; // returns null by default } } diff --git a/src/main/java/org/javaswift/joss/model/StoredObject.java b/src/main/java/org/javaswift/joss/model/StoredObject.java index 63fc5b86..df2e542a 100644 --- a/src/main/java/org/javaswift/joss/model/StoredObject.java +++ b/src/main/java/org/javaswift/joss/model/StoredObject.java @@ -1,5 +1,6 @@ package org.javaswift.joss.model; +import org.apache.http.Header; import org.javaswift.joss.instructions.DownloadInstructions; import org.javaswift.joss.instructions.UploadInstructions; @@ -266,5 +267,6 @@ public interface StoredObject extends ObjectStoreEntity, Comparable