Package org.jclouds.blobstore

Examples of org.jclouds.blobstore.BlobStore


    @Test
    public void testBlobStoreReadWrite() throws InterruptedException {
        if (isBlobStoreLiveConfigured()) {
            createManagedBlobStoreService("aws-s3");
            BlobStore blobStoreService = getOsgiService(BlobStore.class);
            Thread.sleep(DEFAULT_TIMEOUT);

            String featureURL = System.getProperty("jclouds.featureURL");
            System.err.println(executeCommand("jclouds:blobstore-list"));
            System.err.println(executeCommand("jclouds:blobstore-container-create itest-container"));
View Full Code Here


    @Test
    public void testUrlHandler() throws Exception {
        if (isBlobStoreLiveConfigured()) {
            createManagedBlobStoreService("aws-s3");
            BlobStore blobStoreService = getOsgiService(BlobStore.class);
            Thread.sleep(DEFAULT_TIMEOUT);

            FeaturesService featuresService = getOsgiService(FeaturesService.class);
            featuresService.installFeature("jclouds-url-handler");
View Full Code Here

    @Test
    public void testBlobStoreReadWrite() throws InterruptedException {
        if (isBlobStoreLiveConfigured()) {
            createManagedBlobStoreService("cloudfiles-us");
            BlobStore blobStoreService = getOsgiService(BlobStore.class);
            Thread.sleep(DEFAULT_TIMEOUT);

            String featureURL = System.getProperty("jclouds.featureURL");
            System.err.println(executeCommand("jclouds:blobstore-list"));
            System.err.println(executeCommand("jclouds:blobstore-container-create itest-container"));
View Full Code Here

    @Test
    public void testUrlHandler() throws Exception {
        if (isBlobStoreLiveConfigured()) {
            createManagedBlobStoreService("cloudfiles-us");
            BlobStore blobStoreService = getOsgiService(BlobStore.class);
            Thread.sleep(DEFAULT_TIMEOUT);

            FeaturesService featuresService = getOsgiService(FeaturesService.class);
            featuresService.installFeature("jclouds-url-handler");
View Full Code Here

    final String container = Configurator.getBlobStoreProfile(profileName).getContainer();
    BlobStoreContext context = getBlobStoreContext(profileName);

    logger.debug("Storing blob {} on {}", blobName, profileName);

    BlobStore blobStore = context.getBlobStore();
    BlobBuilder blobBuilder = blobStore.blobBuilder(blobName).payload(in).contentLength(size);

    // store blob
    blobStore.putBlob(container, blobBuilder.build());
  }
View Full Code Here

   }

   @Test
   void testToStorageMetadata() {
      assertNull(ToStorageMetadata.INSTANCE.apply(null));
      BlobStore blobStore = getBlobStore();
      blobStore.createContainerInLocation(null, "test");
      blobStore.createDirectory("test", "one");
      Set<StorageMetadata> storageMetadataSet = ImmutableSet.<StorageMetadata>builder()
                                                            .addAll(transform(blobStore.list(), ToStorageMetadata.INSTANCE))
                                                            .build();
      assertFalse(storageMetadataSet.isEmpty());
      StorageMetadata representation = storageMetadataSet.iterator().next();
      assertEquals("test", representation.getName());
   }
View Full Code Here

   }

   @Test
   void testToBlob() {
      assertNull(ToBlob.INSTANCE.apply(null));
      BlobStore blobStore = getBlobStore();
      blobStore.createContainerInLocation(null, "container");
      blobStore.createDirectory("container", "one");

      blobStore.putBlob("container", blobStore.blobBuilder("myblob").payload("testcontent").build());
      Blob representation = ToBlob.INSTANCE.apply(blobStore.getBlob("container", "myblob"));
      assertNotNull(representation);
      assertNotNull(representation.getBlobMetadata());
   }
View Full Code Here

    /**
     * Strategy to perform any pre setup, before {@link org.apache.camel.CamelContext} is created
     */
    @Override
    protected void doPreSetup() throws Exception {
        BlobStore blobStore = ContextBuilder.newBuilder("transient").credentials("identity", "credential").buildView(BlobStoreContext.class).getBlobStore();
        blobStore.createContainerInLocation(null, TEST_CONTAINER);
        blobStore.clearContainer(TEST_CONTAINER);
    }
View Full Code Here

    /**
     * Strategy to perform any pre setup, before {@link org.apache.camel.CamelContext} is created
     */
    @Override
    protected void doPreSetup() throws Exception {
        BlobStore blobStore = ContextBuilder.newBuilder("transient").credentials("identity", "credential").buildView(BlobStoreContext.class).getBlobStore();
        blobStore.createContainerInLocation(null, TEST_CONTAINER);
        blobStore.clearContainer(TEST_CONTAINER);
    }
View Full Code Here

   @Argument(index = 0, name = "containerNames", description = "The name of the container", required = true, multiValued = true)
   final List<String> containerNames = Lists.newLinkedList();

   @Override
   protected Object doExecute() throws Exception {
      BlobStore blobStore = getBlobStore();

      for (String container : containerNames) {
          if (!blobStore.containerExists(container)) {
             throw new ContainerNotFoundException(container, "while checking existence");
          }
      }
      return null;
   }
View Full Code Here

TOP

Related Classes of org.jclouds.blobstore.BlobStore

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.