org.jclouds.http.PayloadEnclosing



API Populatity

2 Client projects

Project: org.jclouds

Package: org.jclouds.http

Project jclouds/jclouds in file ...java.org.jclouds.encryption.EncryptionService.java (2010-07-08)
@@ -25,6 +25,7 @@ import java.security.Key;
 
 import org.jclouds.encryption.internal.JCEEncryptionService;
 import org.jclouds.http.Payload;
+import org.jclouds.http.PayloadEnclosing;
 import org.jclouds.http.payloads.ByteArrayPayload;
 
 import com.google.inject.ImplementedBy;
@@ -55,6 +56,15 @@ public interface EncryptionService {
 
    byte[] md5(InputStream toEncode);
 
+   /**
+    * 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.
+    */
+   <T extends PayloadEnclosing> T generateMD5BufferingIfNotRepeatable(T payloadEnclosing);
+
    Payload generateMD5BufferingIfNotRepeatable(Payload in);
 
    ByteArrayPayload generatePayloadWithMD5For(InputStream toEncode);
Project jclouds/jclouds in file ...c.main.java.org.jclouds.blobstore.domain.Blob.java (2009-12-13)
@@ -23,61 +23,25 @@
  */
 package org.jclouds.blobstore.domain;
 
+import org.jclouds.http.PayloadEnclosing;
+
 import com.google.common.collect.Multimap;
 import com.google.inject.internal.Nullable;
 
 /**
  * Value type for an HTTP Blob service. Blobs are stored in containers and consist
- * of a {@link org.jclouds.blobstore.domain.Value#getData() value}, a {@link Blob#getKey key and
+ * of a {@link org.jclouds.blobstore.domain.Value#getContent() value}, a {@link Blob#getKey key and
  * 
  * @link Blob.Metadata#getUserMetadata() metadata}
  * 
  * @author Adrian Cole
  */
-public interface Blob extends Comparable<Blob> {
+public interface Blob extends PayloadEnclosing, Comparable<Blob> {
    public interface Factory {
       Blob create(@Nullable MutableBlobMetadata 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.
-    */
-   void generateMD5();
-
-   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.
     */
    MutableBlobMetadata getMetadata();
Project jclouds/legacy-jclouds in file ...java.org.jclouds.encryption.EncryptionService.java (2010-07-08)
@@ -25,6 +25,7 @@ import java.security.Key;
 
 import org.jclouds.encryption.internal.JCEEncryptionService;
 import org.jclouds.http.Payload;
+import org.jclouds.http.PayloadEnclosing;
 import org.jclouds.http.payloads.ByteArrayPayload;
 
 import com.google.inject.ImplementedBy;
@@ -55,6 +56,15 @@ public interface EncryptionService {
 
    byte[] md5(InputStream toEncode);
 
+   /**
+    * 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.
+    */
+   <T extends PayloadEnclosing> T generateMD5BufferingIfNotRepeatable(T payloadEnclosing);
+
    Payload generateMD5BufferingIfNotRepeatable(Payload in);
 
    ByteArrayPayload generatePayloadWithMD5For(InputStream toEncode);