Examples of BlobStore


Examples of org.jclouds.blobstore.BlobStore

    @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

Examples of org.jclouds.blobstore.BlobStore

    @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

Examples of org.jclouds.blobstore.BlobStore

    @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

Examples of org.jclouds.blobstore.BlobStore

    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

Examples of org.jclouds.blobstore.BlobStore

   }

   @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

Examples of org.jclouds.blobstore.BlobStore

   }

   @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

Examples of org.jclouds.blobstore.BlobStore

    /**
     * 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

Examples of org.jclouds.blobstore.BlobStore

    /**
     * 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

Examples of org.jclouds.blobstore.BlobStore

   @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

Examples of org.jclouds.blobstore.BlobStore

   @Option(name = "-l", aliases = "--location", description = "Location to create container in", required = false, multiValued = false)
   String locationString = "";

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

      Location location = null;
      if (!locationString.isEmpty()) {
         for (Location loc : blobStore.listAssignableLocations()) {
            if (loc.getId().equalsIgnoreCase(locationString)) {
               location = loc;
               break;
            }
         }
         if (location == null) {
            throw new IllegalArgumentException("unknown location: " + locationString);
         }
      }

      for (String container : containerNames) {
         boolean created = blobStore.createContainerInLocation(location, container);
         if (!created) {
            if (blobStore.containerExists(container)) {
               throw new Exception("Container already exists: " + container);
            }

            throw new Exception("Could not create container: " + container);
         }
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.