Esempio n. 1
0
  @Provides
  @LazySingleton
  public final CloudBlobClient getCloudBlobClient(final AzureAccountConfig config)
      throws URISyntaxException, InvalidKeyException {
    CloudStorageAccount account =
        CloudStorageAccount.parse(
            String.format(
                STORAGE_CONNECTION_STRING,
                config.getProtocol(),
                config.getAccount(),
                config.getKey()));

    return account.createCloudBlobClient();
  }
  protected static MockCloudBlobClient createBlobClient(
      String storageAccountName, String storageAccountKey)
      throws InvalidKeyException, URISyntaxException {
    String storageconnectionstring =
        "DefaultEndpointsProtocol=http;AccountName="
            + storageAccountName
            + ";AccountKey="
            + storageAccountKey;
    CloudStorageAccount storageAccount = CloudStorageAccount.parse(storageconnectionstring);

    // Create the blob client
    CloudBlobClient blobClient = storageAccount.createCloudBlobClient();
    return new MockCloudBlobClient(blobClient, IS_MOCKED);
  }