Codota Logo
AtmosObject.setPayload
Code IndexAdd Codota 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)

  • Common ways to obtain AtmosObject
private void myMethod () {
AtmosObject a =
  • Codota IconObject obj;AtmosObject.class.cast(obj)
  • Codota IconAtmosObject.Factory atmosObjectFactory;atmosObjectFactory.create((MutableContentMetadata)null)
  • Codota IconBlobMetadataToObject blobMetadataToObject;Blob blob;blobMetadataToObject.apply(blob.getMetadata())
  • Smart code suggestions by Codota
}
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

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JCheckBox (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now