Tabnine Logo
AtmosObject.setPayload
Code IndexAdd Tabnine to your IDE (free)

How to use
setPayload
method
in
org.jclouds.atmos.domain.AtmosObject

Best Java code snippets using org.jclouds.atmos.domain.AtmosObject.setPayload (Showing top 20 results out of 315)

origin: apache/jclouds

  public AtmosObject apply(Blob from) {
   if (from == null)
     return null;
   AtmosObject object = blobMd2Object.apply(from.getMetadata());
   object.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   object.setAllHeaders(from.getAllHeaders());
   return object;
  }
}
origin: jclouds/legacy-jclouds

  public AtmosObject apply(Blob from) {
   if (from == null)
     return null;
   AtmosObject object = blobMd2Object.apply(from.getMetadata());
   object.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   object.setAllHeaders(from.getAllHeaders());
   return object;
  }
}
origin: com.amysta.jclouds.api/atmos

  public AtmosObject apply(Blob from) {
   if (from == null)
     return null;
   AtmosObject object = blobMd2Object.apply(from.getMetadata());
   object.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   object.setAllHeaders(from.getAllHeaders());
   return object;
  }
}
origin: Nextdoor/bender

  public AtmosObject apply(Blob from) {
   if (from == null)
     return null;
   AtmosObject object = blobMd2Object.apply(from.getMetadata());
   object.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   object.setAllHeaders(from.getAllHeaders());
   return object;
  }
}
origin: org.jclouds.api/atmos

  public AtmosObject apply(Blob from) {
   if (from == null)
     return null;
   AtmosObject object = blobMd2Object.apply(from.getMetadata());
   object.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   object.setAllHeaders(from.getAllHeaders());
   return object;
  }
}
origin: io.cloudsoft.jclouds.api/atmos

  public AtmosObject apply(Blob from) {
   if (from == null)
     return null;
   AtmosObject object = blobMd2Object.apply(from.getMetadata());
   object.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   object.setAllHeaders(from.getAllHeaders());
   return object;
  }
}
origin: org.apache.jclouds.api/atmos

  public AtmosObject apply(Blob from) {
   if (from == null)
     return null;
   AtmosObject object = blobMd2Object.apply(from.getMetadata());
   object.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   object.setAllHeaders(from.getAllHeaders());
   return object;
  }
}
origin: jclouds/legacy-jclouds

@Test(expectedExceptions = IllegalArgumentException.class)
public void testNullContentLengthIllegal() {
 AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null);
 Payload payload = Payloads.newStringPayload("");
 payload.getContentMetadata().setContentLength(null);
 object.setPayload(payload);
 HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build();
 binder.bindToRequest(request, object);
}
origin: jclouds/legacy-jclouds

public void testGood() {
 AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null);
 Payload payload = Payloads.newStringPayload("");
 object.setPayload(payload);
 object.getUserMetadata().getListableMetadata().put("apple", "bear");
 object.getUserMetadata().getListableMetadata().put("sushi", "king");
 HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build();
 request = binder.bindToRequest(request, object);
 assertEquals(request.getFirstHeaderOrNull("x-emc-listable-meta"), "apple=bear,sushi=king");
}
origin: apache/jclouds

@Test(expectedExceptions = IllegalArgumentException.class)
public void testNullContentLengthIllegal() {
 AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null);
 Payload payload = Payloads.newStringPayload("");
 payload.getContentMetadata().setContentLength(null);
 object.setPayload(payload);
 HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build();
 binder.bindToRequest(request, object);
}
origin: apache/jclouds

public void testGood() {
 AtmosObject object = injector.getInstance(AtmosObject.Factory.class).create(null);
 Payload payload = Payloads.newStringPayload("");
 object.setPayload(payload);
 object.getUserMetadata().getListableMetadata().put("apple", "bear");
 object.getUserMetadata().getListableMetadata().put("sushi", "king");
 HttpRequest request = HttpRequest.builder().method("GET").endpoint("http://localhost").build();
 request = binder.bindToRequest(request, object);
 assertEquals(request.getFirstHeaderOrNull("x-emc-listable-meta"), "apple=bear,sushi=king");
}
origin: apache/jclouds

@Test(timeOut = 5 * 60 * 1000, dependsOnMethods = { "testFileOperations" })
public void testPutZeroLengthBlob() throws Exception {
 AtmosObject object = getApi().newObject();
 object.getContentMetadata().setName("object");
 byte[] payload = new byte[0];
 object.setPayload(Payloads.newPayload(payload));
 object.getContentMetadata().setContentLength(Long.valueOf(payload.length));
 replaceObject(object);
}
origin: jclouds/legacy-jclouds

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 return object;
}
origin: Nextdoor/bender

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 return object;
}
origin: org.jclouds.api/atmos

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 return object;
}
origin: io.cloudsoft.jclouds.api/atmos

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 return object;
}
origin: com.amysta.jclouds.api/atmos

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 return object;
}
origin: org.apache.jclouds.api/atmos

/**
* First, calls {@link ParseSystemAndUserMetadataFromHeaders}.
* 
* Then, sets the object size based on the Content-Length header and adds the content to the
* {@link AtmosObject} result.
* 
* @throws org.jclouds.http.HttpException
*/
public AtmosObject apply(HttpResponse from) {
 checkNotNull(from, "http response");
 AtmosObject object = objectProvider.create(systemMetadataParser.apply(from), userMetadataParser.apply(from));
 object.getContentMetadata().setName(object.getSystemMetadata().getObjectName());
 object.getContentMetadata().setPath(path);
 object.getContentMetadata().setUri(uri);
 object.getAllHeaders().putAll(from.getHeaders());
 object.setPayload(from.getPayload());
 object.getContentMetadata().setContentLength(attemptToParseSizeAndRangeFromHeaders(from));
 object.getContentMetadata().setContentMD5(object.getSystemMetadata().getContentMD5());
 return object;
}
origin: apache/jclouds

private void createOrReplaceObject(String name, Object data, HashCode hashCode, String metadataValue) throws Exception {
 // Test PUT with string data, ETag hash, and a piece of metadata
 AtmosObject object = getApi().newObject();
 object.getContentMetadata().setName(name);
 object.setPayload(Payloads.newPayload(data));
 object.getContentMetadata().setContentLength(16L);
 object.getContentMetadata().setContentMD5(hashCode.asBytes());
 object.getContentMetadata().setContentType("text/plain");
 object.getUserMetadata().getMetadata().put("Metadata", metadataValue);
 replaceObject(object);
}
origin: jclouds/legacy-jclouds

private void createOrReplaceObject(String name, Object data, String metadataValue) throws Exception {
 // Test PUT with string data, ETag hash, and a piece of metadata
 AtmosObject object = getApi().newObject();
 object.getContentMetadata().setName(name);
 object.setPayload(Payloads.newPayload(data));
 object.getContentMetadata().setContentLength(16l);
 Payloads.calculateMD5(object);
 object.getContentMetadata().setContentType("text/plain");
 object.getUserMetadata().getMetadata().put("Metadata", metadataValue);
 replaceObject(object);
}
org.jclouds.atmos.domainAtmosObjectsetPayload

Popular methods of AtmosObject

  • getContentMetadata
  • getPayload
  • getSystemMetadata
  • getUserMetadata
  • getAllHeaders
  • setAllHeaders

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now