Examples of ObjectMetadata


Examples of com.netflix.astyanax.recipes.storage.ObjectMetadata

    {
      throw new ISE("outDir[%s] must be a directory.", outDir);
    }

    long startTime = System.currentTimeMillis();
    ObjectMetadata meta = null;
    final File outFile = new File(outDir, "index.zip");
    try
    {
      try
      {
        log.info("Writing to [%s]", outFile.getAbsolutePath());
        OutputStream os = Files.newOutputStreamSupplier(outFile).getOutput();
        meta = ChunkedStorage
            .newReader(indexStorage, key, os)
            .withBatchSize(BATCH_SIZE)
            .withConcurrencyLevel(CONCURRENCY)
            .call();
        os.close();
        CompressionUtils.unzip(outFile, outDir);
      } catch (Exception e)
      {
        FileUtils.deleteDirectory(outDir);
      }
    } catch (Exception e)
    {
      throw new SegmentLoadingException(e, e.getMessage());
    }
    log.info("Pull of file[%s] completed in %,d millis (%s bytes)", key, System.currentTimeMillis() - startTime,
        meta.getObjectSize());
  }
View Full Code Here

Examples of org.jclouds.s3.domain.ObjectMetadata

         getApi().copyObject(containerName, sourceKey, destinationContainer, destinationKey,
                  overrideMetadataWith(metadata));

         validateContent(destinationContainer, destinationKey);

         ObjectMetadata objectMeta = getApi().headObject(destinationContainer, destinationKey);

         assertEquals(objectMeta.getUserMetadata(), metadata);
      } finally {
         returnContainer(containerName);
         returnContainer(destinationContainer);

      }
View Full Code Here

Examples of org.jclouds.s3.domain.ObjectMetadata

            storageClass(StorageClass.REDUCED_REDUNDANCY));

         S3Client s3Client = S3Client.class.cast(view.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi());
         ListBucketResponse response = s3Client.listBucket(containerName, withPrefix(blobName));

         ObjectMetadata metadata = response.iterator().next();
         assertEquals(metadata.getStorageClass(), StorageClass.REDUCED_REDUNDANCY);

      } finally {
         returnContainer(containerName);
      }
   }
View Full Code Here

Examples of org.jclouds.s3.domain.ObjectMetadata

@Test(groups = "unit", testName = "BindObjectMetadataToRequestTest")
public class BindObjectMetadataToRequestTest extends BaseS3AsyncClientTest<S3AsyncClient> {

   @Test
   public void testPassWithMinimumDetailsAndPayload5GB() {
      ObjectMetadata md = ObjectMetadataBuilder.create().key("foo").build();

      HttpRequest request = HttpRequest.builder().method("POST").endpoint("http://localhost").build();
      BindObjectMetadataToRequest binder = injector.getInstance(BindObjectMetadataToRequest.class);

      assertEquals(binder.bindToRequest(request, md), HttpRequest.builder().method("POST")
View Full Code Here

Examples of org.jclouds.s3.domain.ObjectMetadata

               .endpoint("http://localhost").addHeader("Content-Type", "binary/octet-stream").build());
   }

   @Test
   public void testExtendedPropertiesBind() {
      ObjectMetadata md = ObjectMetadataBuilder.create().key("foo").cacheControl("no-cache").userMetadata(
               ImmutableMap.of("foo", "bar")).build();

      HttpRequest request = HttpRequest.builder().method("POST").endpoint("http://localhost").build();
      BindObjectMetadataToRequest binder = injector.getInstance(BindObjectMetadataToRequest.class);
View Full Code Here

Examples of org.jclouds.s3.domain.ObjectMetadata

                        "binary/octet-stream")).build());
   }

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testNoKeyIsBad() {
      ObjectMetadata md = ObjectMetadataBuilder.create().build();

      HttpRequest request = HttpRequest.builder().method("POST").endpoint("http://localhost").build();
      BindObjectMetadataToRequest binder = injector.getInstance(BindObjectMetadataToRequest.class);
      binder.bindToRequest(request, md);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.