@author Adrian Cole
/**
* This implementation invokes {@link AtmosClient#readFile}
*/
@Override
public Blob getBlob(String container, String key, org.jclouds.blobstore.options.GetOptions options) {
GetOptions httpOptions = blob2ObjectGetOptions.apply(options);
return object2Blob.apply(sync.readFile(container + "/" + key, httpOptions));
}
/**
* This implementation invokes {@link AtmosAsyncClient#readFile}
*/
@Override
public ListenableFuture<Blob> getBlob(String container, String key, org.jclouds.blobstore.options.GetOptions options) {
GetOptions httpOptions = blob2ObjectGetOptions.apply(options);
ListenableFuture<AtmosObject> returnVal = async.readFile(container + "/" + key, httpOptions);
return transform(returnVal, object2Blob, userExecutor);
}
@BinderParam(BindToStringPayload.class) String payload);
}
public void testCreateGetVarArgOptionsThatProducesHeaders() throws SecurityException, NoSuchMethodException {
Date date = new Date();
GetOptions options = GetOptions.Builder.ifModifiedSince(date);
Invokable<?, ?> method = method(TestRequest.class, "get", String.class,
HttpRequestOptions[].class);
GeneratedHttpRequest request = processor.apply(Invocation.create(method,
ImmutableList.<Object> of("1", options)));
assertEquals(request.getEndpoint().getHost(), "localhost");
ImmutableList.of(dateService.rfc822DateFormat(date)));
}
public void testCreateGetOptionsThatProducesHeaders() throws SecurityException, NoSuchMethodException {
Date date = new Date();
GetOptions options = GetOptions.Builder.ifModifiedSince(date);
Invokable<?, ?> method = method(TestRequest.class, "get", String.class, HttpRequestOptions.class);
GeneratedHttpRequest request = processor.apply(Invocation.create(method,
ImmutableList.<Object> of("1", options)));
assertEquals(request.getEndpoint().getHost(), "localhost");
assertEquals(request.getEndpoint().getPath(), "/1");
* @param key
* file name
*/
@Override
public Blob getBlob(String container, String key, org.jclouds.blobstore.options.GetOptions optionsList) {
GetOptions httpOptions = blob2ObjectGetOptions.apply(optionsList);
return object2Blob.apply(sync.getObject(container, key, httpOptions));
}
* @param key
* object key
*/
@Override
public ListenableFuture<Blob> getBlob(String container, String key, org.jclouds.blobstore.options.GetOptions options) {
GetOptions httpOptions = blob2ObjectGetOptions.apply(options);
ListenableFuture<SwiftObject> returnVal = async.getObject(container, key, httpOptions);
return transform(returnVal, object2Blob, userExecutor);
}
* @param key
* object key
*/
@Override
public ListenableFuture<Blob> getBlob(String container, String key, org.jclouds.blobstore.options.GetOptions options) {
GetOptions httpOptions = blob2ObjectGetOptions.apply(options);
ListenableFuture<SwiftObject> returnVal = async.getObject(container, key, httpOptions);
return transform(returnVal, object2Blob, userExecutor);
}
* @param key
* blob key
*/
@Override
public Blob getBlob(String container, String key, org.jclouds.blobstore.options.GetOptions options) {
GetOptions azureOptions = blob2ObjectGetOptions.apply(options);
return azureBlob2Blob.apply(sync.getBlob(container, key, azureOptions));
}
* @param key
* blob key
*/
@Override
public ListenableFuture<Blob> getBlob(String container, String key, org.jclouds.blobstore.options.GetOptions options) {
GetOptions azureOptions = blob2ObjectGetOptions.apply(options);
ListenableFuture<AzureBlob> returnVal = async.getBlob(container, key, azureOptions);
return transform(returnVal, azureBlob2Blob, userExecutor);
}
@BinderParam(BindToStringPayload.class) String payload);
}
public void testCreateGetVarArgOptionsThatProducesHeaders() throws SecurityException, NoSuchMethodException {
Date date = new Date();
GetOptions options = GetOptions.Builder.ifModifiedSince(date);
Invokable<?, ?> method = method(TestRequest.class, "get", String.class,
HttpRequestOptions[].class);
GeneratedHttpRequest request = processor.apply(Invocation.create(method,
ImmutableList.<Object> of("1", options)));
assertEquals(request.getEndpoint().getHost(), "localhost");
Related Classes of org.jclouds.http.options.GetOptions$Builder
Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.