java.io.IOExceptionorg.jclouds.http.PayloadEnclosing



Project jclouds/jclouds in file ...g.jclouds.atmosonline.saas.domain.AtmosObject.java (2009-12-13)
@@ -23,14 +23,14 @@
  */
 package org.jclouds.atmosonline.saas.domain;
 
-import java.io.IOException;
+import org.jclouds.http.PayloadEnclosing;
 
 import com.google.common.collect.Multimap;
 import com.google.inject.internal.Nullable;
 
 /**
  * Amazon Atmos is designed to store objects. Objects are stored in buckets and consist of a
- * {@link ObjectMetadataAtmosObject#getData() value}, a {@link ObjectMetadata#getKey key},
+ * {@link ObjectMetadataAtmosObject#getContent() value}, a {@link ObjectMetadata#getKey key},
  * {@link ObjectMetadata#getUserMetadata() metadata}, and an access control policy.
  * 
  * @author Adrian Cole
@@ -38,7 +38,7 @@ import com.google.inject.internal.Nullable;
  *      href="http://docs.amazonwebservices.com/AmazonAtmos/2006-03-01/index.html?UsingObjects.html"
  *      />
  */
-public interface AtmosObject extends Comparable<AtmosObject> {
+public interface AtmosObject extends PayloadEnclosing, Comparable<AtmosObject> {
    public interface Factory {
       AtmosObject create(@Nullable MutableContentMetadata contentMetadata);
 
@@ -49,33 +49,6 @@ public interface AtmosObject extends Comparable<AtmosObject> {
 
    }
 
-   /**
-    * generate an MD5 Hash for the current data.
-    * <p/>
-    * <h2>Note</h2>
-    * <p/>
-    * If this is an InputStream, it will be converted to a byte array first.
-    * 
-    * @throws IOException
-    *            if there is a problem generating the hash.
-    */
-   void generateMD5() throws IOException;
-
-   /**
-    * Sets entity for the request or the content from the response. If size isn't set, this will
-    * attempt to discover it.
-    * 
-    * @param data
-    *           typically InputStream for downloads, or File, byte [], String, or InputStream for
-    *           uploads.
-    */
-   void setData(Object data);
-
-   /**
-    * @return InputStream, if downloading, or whatever was set during {@link #setData(Object)}
-    */
-   Object getData();
-
    MutableContentMetadata getContentMetadata();
 
    /**
Project jclouds/jclouds in file ....main.java.org.jclouds.aws.s3.domain.S3Object.java (2009-12-13)
@@ -23,67 +23,26 @@
  */
 package org.jclouds.aws.s3.domain;
 
-import java.io.IOException;
+import org.jclouds.http.PayloadEnclosing;
 
 import com.google.common.collect.Multimap;
 import com.google.inject.internal.Nullable;
 
 /**
  * Amazon S3 is designed to store objects. Objects are stored in buckets and consist of a
- * {@link ObjectMetadataS3Object#getData() value}, a {@link ObjectMetadata#getKey key},
+ * {@link ObjectMetadataS3Object#getContent() value}, a {@link ObjectMetadata#getKey key},
  * {@link ObjectMetadata#getUserMetadata() metadata}, and an access control policy.
  * 
  * @author Adrian Cole
  * @see <a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?UsingObjects.html"
  *      />
  */
-public interface S3Object extends Comparable<S3Object> {
+public interface S3Object extends PayloadEnclosing, Comparable<S3Object> {
    public interface Factory {
       S3Object create(@Nullable MutableObjectMetadata metadata);
    }
 
    /**
-    * Sets entity for the request or the content from the response. If size isn't set, this will
-    * attempt to discover it.
-    * 
-    * @param data
-    *           typically InputStream for downloads, or File, byte [], String, or InputStream for
-    *           uploads.
-    */
-   void setData(Object data);
-
-   /**
-    * @return InputStream, if downloading, or whatever was set during {@link #setData(Object)}
-    */
-   Object getData();
-
-   /**
-    * generate an MD5 Hash for the current data.
-    * <p/>
-    * <h2>Note</h2>
-    * <p/>
-    * If this is an InputStream, it will be converted to a byte array first.
-    * 
-    * @throws IOException
-    *            if there is a problem generating the hash.
-    */
-   void generateMD5() throws IOException;
-
-   void setContentLength(long contentLength);
-
-   /**
-    * Returns the total size of the downloaded object, or the chunk that's available.
-    * <p/>
-    * Chunking is only used when org.jclouds.http.GetOptions is called with options like tail,
-    * range, or startAt.
-    * 
-    * @return the length in bytes that can be be obtained from {@link #getData()}
-    * @see org.jclouds.http.HttpHeaders#CONTENT_LENGTH
-    * @see GetObjectOptions
-    */
-   Long getContentLength();
-
-   /**
     * @return System and User metadata relevant to this object.
     */
    MutableObjectMetadata getMetadata();
Project jclouds/jclouds in file ...g.jclouds.azure.storage.blob.domain.AzureBlob.java (2009-12-13)
@@ -23,67 +23,26 @@
  */
 package org.jclouds.azure.storage.blob.domain;
 
-import java.io.IOException;
+import org.jclouds.http.PayloadEnclosing;
 
 import com.google.common.collect.Multimap;
 import com.google.inject.internal.Nullable;
 
 /**
  * Amazon S3 is designed to store objects. Objects are stored in buckets and consist of a
- * {@link ObjectPropertiesBlob#getData() value}, a {@link ObjectProperties#getKey key},
+ * {@link ObjectPropertiesBlob#getContent() value}, a {@link ObjectProperties#getKey key},
  * {@link ObjectProperties#getUserProperties() metadata}, and an access control policy.
  * 
  * @author Adrian Cole
  * @see <a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?UsingObjects.html"
  *      />
  */
-public interface AzureBlob extends Comparable<AzureBlob> {
+public interface AzureBlob extends PayloadEnclosing, Comparable<AzureBlob> {
    public interface Factory {
       AzureBlob create(@Nullable MutableBlobProperties properties);
    }
 
    /**
-    * Sets entity for the request or the content from the response. If size isn't set, this will
-    * attempt to discover it.
-    * 
-    * @param data
-    *           typically InputStream for downloads, or File, byte [], String, or InputStream for
-    *           uploads.
-    */
-   void setData(Object data);
-
-   /**
-    * @return InputStream, if downloading, or whatever was set during {@link #setData(Object)}
-    */
-   Object getData();
-
-   /**
-    * generate an MD5 Hash for the current data.
-    * <p/>
-    * <h2>Note</h2>
-    * <p/>
-    * If this is an InputStream, it will be converted to a byte array first.
-    * 
-    * @throws IOException
-    *            if there is a problem generating the hash.
-    */
-   void generateMD5() throws IOException;
-
-   void setContentLength(long contentLength);
-
-   /**
-    * Returns the total size of the downloaded object, or the chunk that's available.
-    * <p/>
-    * Chunking is only used when org.jclouds.http.GetOptions is called with options like tail,
-    * range, or startAt.
-    * 
-    * @return the length in bytes that can be be obtained from {@link #getData()}
-    * @see org.jclouds.http.HttpHeaders#CONTENT_LENGTH
-    * @see GetObjectOptions
-    */
-   Long getContentLength();
-
-   /**
     * @return System and User metadata relevant to this object.
     */
    MutableBlobProperties getProperties();
Project jclouds/jclouds in file ....jclouds.rackspace.cloudfiles.domain.CFObject.java (2009-12-13)
@@ -23,7 +23,7 @@
  */
 package org.jclouds.rackspace.cloudfiles.domain;
 
-import java.io.IOException;
+import org.jclouds.http.PayloadEnclosing;
 
 import com.google.common.collect.Multimap;
 import com.google.inject.internal.Nullable;
@@ -32,53 +32,12 @@ import com.google.inject.internal.Nullable;
  * 
  * @author Adrian Cole
  */
-public interface CFObject extends Comparable<CFObject> {
+public interface CFObject extends PayloadEnclosing, Comparable<CFObject> {
    public interface Factory {
       CFObject create(@Nullable MutableObjectInfoWithMetadata info);
    }
 
    /**
-    * Sets entity for the request or the content from the response. If size isn't set, this will
-    * attempt to discover it.
-    * 
-    * @param data
-    *           typically InputStream for downloads, or File, byte [], String, or InputStream for
-    *           uploads.
-    */
-   void setData(Object data);
-
-   /**
-    * @return InputStream, if downloading, or whatever was set during {@link #setData(Object)}
-    */
-   Object getData();
-
-   /**
-    * generate an MD5 Hash for the current data.
-    * <p/>
-    * <h2>Note</h2>
-    * <p/>
-    * If this is an InputStream, it will be converted to a byte array first.
-    * 
-    * @throws IOException
-    *            if there is a problem generating the hash.
-    */
-   void generateMD5() throws IOException;
-
-   void setContentLength(long contentLength);
-
-   /**
-    * Returns the total size of the downloaded object, or the chunk that's available.
-    * <p/>
-    * Chunking is only used when org.jclouds.http.GetOptions is called with options like tail,
-    * range, or startAt.
-    * 
-    * @return the length in bytes that can be be obtained from {@link #getData()}
-    * @see org.jclouds.http.HttpHeaders#CONTENT_LENGTH
-    * @see GetObjectOptions
-    */
-   Long getContentLength();
-
-   /**
     * @return System and User metadata relevant to this object.
     */
    MutableObjectInfoWithMetadata getInfo();
Project jclouds/legacy-jclouds in file ...g.jclouds.atmosonline.saas.domain.AtmosObject.java (2009-12-13)
@@ -23,14 +23,14 @@
  */
 package org.jclouds.atmosonline.saas.domain;
 
-import java.io.IOException;
+import org.jclouds.http.PayloadEnclosing;
 
 import com.google.common.collect.Multimap;
 import com.google.inject.internal.Nullable;
 
 /**
  * Amazon Atmos is designed to store objects. Objects are stored in buckets and consist of a
- * {@link ObjectMetadataAtmosObject#getData() value}, a {@link ObjectMetadata#getKey key},
+ * {@link ObjectMetadataAtmosObject#getContent() value}, a {@link ObjectMetadata#getKey key},
  * {@link ObjectMetadata#getUserMetadata() metadata}, and an access control policy.
  * 
  * @author Adrian Cole
@@ -38,7 +38,7 @@ import com.google.inject.internal.Nullable;
  *      href="http://docs.amazonwebservices.com/AmazonAtmos/2006-03-01/index.html?UsingObjects.html"
  *      />
  */
-public interface AtmosObject extends Comparable<AtmosObject> {
+public interface AtmosObject extends PayloadEnclosing, Comparable<AtmosObject> {
    public interface Factory {
       AtmosObject create(@Nullable MutableContentMetadata contentMetadata);
 
@@ -49,33 +49,6 @@ public interface AtmosObject extends Comparable<AtmosObject> {
 
    }
 
-   /**
-    * generate an MD5 Hash for the current data.
-    * <p/>
-    * <h2>Note</h2>
-    * <p/>
-    * If this is an InputStream, it will be converted to a byte array first.
-    * 
-    * @throws IOException
-    *            if there is a problem generating the hash.
-    */
-   void generateMD5() throws IOException;
-
-   /**
-    * Sets entity for the request or the content from the response. If size isn't set, this will
-    * attempt to discover it.
-    * 
-    * @param data
-    *           typically InputStream for downloads, or File, byte [], String, or InputStream for
-    *           uploads.
-    */
-   void setData(Object data);
-
-   /**
-    * @return InputStream, if downloading, or whatever was set during {@link #setData(Object)}
-    */
-   Object getData();
-
    MutableContentMetadata getContentMetadata();
 
    /**