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

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

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

origin: jclouds/legacy-jclouds

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: org.jclouds.api/atmos

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: apache/jclouds

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   byte[] contentMD5 = object.getContentMetadata().getContentMD5();
   if (contentMD5 != null) {
     request = (R) request.toBuilder()
        .addHeader(AtmosHeaders.CHECKSUM, "MD5/0/" +
           BaseEncoding.base16().encode(contentMD5))
        .build();
   }
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: io.cloudsoft.jclouds.api/atmos

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   byte[] contentMD5 = object.getContentMetadata().getContentMD5();
   if (contentMD5 != null) {
     request = (R) request.toBuilder()
        .addHeader(AtmosHeaders.CHECKSUM, "MD5/0/" +
           BaseEncoding.base16().encode(contentMD5))
        .build();
   }
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: com.amysta.jclouds.api/atmos

  @Override
  public <R extends HttpRequest> R bindToRequest(R request, Object input) {
   checkArgument(checkNotNull(input, "input") instanceof AtmosObject, "this binder is only valid for AtmosObject!");
   checkNotNull(request, "request");

   AtmosObject object = AtmosObject.class.cast(input);
   checkNotNull(object.getPayload(), "object payload");
   checkArgument(object.getPayload().getContentMetadata().getContentLength() != null,
      "contentLength must be set, streaming not supported");
   byte[] contentMD5 = object.getContentMetadata().getContentMD5();
   if (contentMD5 != null) {
     request = (R) request.toBuilder()
        .addHeader(AtmosHeaders.CHECKSUM, "MD5/0/" +
           BaseEncoding.base16().encode(contentMD5))
        .build();
   }
   return metaBinder.bindToRequest(request, object.getUserMetadata());
  }
}
origin: jclouds/legacy-jclouds

protected void retryAndCheckSystemMetadataAndPutIfPresentReplaceStrategy(AtmosObject object) throws Exception {
 int failures = 0;
 while (true) {
   try {
    checkSystemMetadataAndPutIfPresentReplaceStrategy(object);
    break;
   } catch (ExecutionException e1) {// bug
    if (!(e1.getCause() instanceof KeyAlreadyExistsException))
      throw e1;
    else
      failures++;
   }
 }
 if (failures > 0)
   System.err.printf("%d failures create/replacing %s%n", failures,
       object.getPayload() instanceof InputStreamPayload ? "stream" : "string");
}
origin: apache/jclouds

protected void retryAndCheckSystemMetadataAndPutIfPresentReplaceStrategy(AtmosObject object) throws Exception {
 int failures = 0;
 while (true) {
   try {
    checkSystemMetadataAndPutIfPresentReplaceStrategy(object);
    break;
   } catch (ExecutionException e1) {// bug
    if (!(e1.getCause() instanceof KeyAlreadyExistsException))
      throw e1;
    else
      failures++;
   }
 }
 if (failures > 0)
   System.err.printf("%d failures create/replacing %s%n", failures,
       object.getPayload() instanceof InputStreamPayload ? "stream" : "string");
}
origin: jclouds/legacy-jclouds

private void alwaysDeleteFirstReplaceStrategy(AtmosObject object) throws Exception {
 deleteConfirmed(privateDirectory + "/" + object.getContentMetadata().getName());
 long time = System.currentTimeMillis();
 try {
   getApi().createFile(privateDirectory, object);
   System.err.printf("%s %s; %dms%n", "created", object.getPayload() instanceof InputStreamPayload ? "stream"
       : "string", System.currentTimeMillis() - time);
 } catch (Exception e) {
   String message = Throwables.getRootCause(e).getMessage();
   System.err.printf("failure %s %s; %dms: [%s]%n", "creating",
       object.getPayload() instanceof InputStreamPayload ? "stream" : "string", System.currentTimeMillis()
            - time, message);
   throw e;
 }
}
origin: apache/jclouds

private void alwaysDeleteFirstReplaceStrategy(AtmosObject object) throws Exception {
 deleteConfirmed(privateDirectory + "/" + object.getContentMetadata().getName());
 long time = System.currentTimeMillis();
 try {
   getApi().createFile(privateDirectory, object);
   System.err.printf("%s %s; %dms%n", "created", object.getPayload() instanceof InputStreamPayload ? "stream"
       : "string", System.currentTimeMillis() - time);
 } catch (Exception e) {
   String message = Throwables.getRootCause(e).getMessage();
   System.err.printf("failure %s %s; %dms: [%s]%n", "creating",
       object.getPayload() instanceof InputStreamPayload ? "stream" : "string", System.currentTimeMillis()
            - time, message);
   throw e;
 }
}
origin: jclouds/legacy-jclouds

private static void verifyObject(AtmosClient connection, String path, String compare, String metadataValue)
    throws InterruptedException, ExecutionException, TimeoutException, IOException {
 AtmosObject getBlob = connection.readFile(path);
 assertEquals(Strings2.toString(getBlob.getPayload()), compare);
 verifyMetadata(metadataValue, getBlob);
}
origin: jclouds/legacy-jclouds

private static void verifyHeadObject(AtmosClient connection, String path, String metadataValue)
    throws InterruptedException, ExecutionException, TimeoutException, IOException {
 AtmosObject getBlob = connection.headFile(path);
 assertEquals(Strings2.toString(getBlob.getPayload()), "");
 verifyMetadata(metadataValue, getBlob);
}
origin: jclouds/legacy-jclouds

  public Blob apply(AtmosObject from) {
   if (from == null)
     return null;
   Blob blob = blobFactory.create(object2BlobMd.apply(from));
   blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata());
   blob.setAllHeaders(from.getAllHeaders());
   return blob;
  }
}
origin: org.jclouds.api/atmos

  public Blob apply(AtmosObject from) {
   if (from == null)
     return null;
   Blob blob = blobFactory.create(object2BlobMd.apply(from));
   blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata());
   blob.setAllHeaders(from.getAllHeaders());
   return blob;
  }
}
origin: io.cloudsoft.jclouds.api/atmos

  public Blob apply(AtmosObject from) {
   if (from == null)
     return null;
   Blob blob = blobFactory.create(object2BlobMd.apply(from));
   blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata());
   blob.setAllHeaders(from.getAllHeaders());
   return blob;
  }
}
origin: com.amysta.jclouds.api/atmos

  public Blob apply(AtmosObject from) {
   if (from == null)
     return null;
   Blob blob = blobFactory.create(object2BlobMd.apply(from));
   blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata());
   blob.setAllHeaders(from.getAllHeaders());
   return blob;
  }
}
origin: org.apache.jclouds.api/atmos

  public Blob apply(AtmosObject from) {
   if (from == null)
     return null;
   Blob blob = blobFactory.create(object2BlobMd.apply(from));
   blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata());
   blob.setAllHeaders(from.getAllHeaders());
   return blob;
  }
}
origin: Nextdoor/bender

  public Blob apply(AtmosObject from) {
   if (from == null)
     return null;
   Blob blob = blobFactory.create(object2BlobMd.apply(from));
   blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata());
   blob.setAllHeaders(from.getAllHeaders());
   return blob;
  }
}
origin: apache/jclouds

  public Blob apply(AtmosObject from) {
   if (from == null)
     return null;
   Blob blob = blobFactory.create(object2BlobMd.apply(from));
   blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from));
   HttpUtils.copy(from.getContentMetadata(), blob.getPayload().getContentMetadata());
   blob.setAllHeaders(from.getAllHeaders());
   return blob;
  }
}
origin: apache/jclouds

private static void verifyObject(AtmosClient connection, String path, String compare, String metadataValue)
    throws InterruptedException, ExecutionException, TimeoutException, IOException {
 AtmosObject getBlob = connection.readFile(path);
 assertEquals(Strings2.toStringAndClose(getBlob.getPayload().openStream()), compare);
 verifyMetadata(metadataValue, getBlob);
}
origin: apache/jclouds

private static void verifyHeadObject(AtmosClient connection, String path, String metadataValue)
    throws InterruptedException, ExecutionException, TimeoutException, IOException {
 AtmosObject getBlob = connection.headFile(path);
 assertEquals(Strings2.toStringAndClose(getBlob.getPayload().openStream()), "");
 verifyMetadata(metadataValue, getBlob);
}
org.jclouds.atmos.domainAtmosObjectgetPayload

Popular methods of AtmosObject

  • getContentMetadata
  • getSystemMetadata
  • getUserMetadata
  • setPayload
  • getAllHeaders
  • setAllHeaders

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top Vim plugins
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