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

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Notification (javax.management)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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