Class Utils
- java.lang.Object
-
- org.apache.jackrabbit.oak.blob.cloud.azure.blobstorage.Utils
-
public final class Utils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DASH
static java.lang.String
DEFAULT_CONFIG_FILE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.microsoft.azure.storage.blob.CloudBlobClient
getBlobClient(@NotNull java.lang.String connectionString)
Create CloudBlobClient from properties.static com.microsoft.azure.storage.blob.CloudBlobClient
getBlobClient(@NotNull java.lang.String connectionString, @Nullable com.microsoft.azure.storage.blob.BlobRequestOptions requestOptions)
static com.microsoft.azure.storage.blob.CloudBlobContainer
getBlobContainer(@NotNull java.lang.String connectionString, @NotNull java.lang.String containerName)
static com.microsoft.azure.storage.blob.CloudBlobContainer
getBlobContainer(@NotNull java.lang.String connectionString, @NotNull java.lang.String containerName, @Nullable com.microsoft.azure.storage.blob.BlobRequestOptions requestOptions)
static java.lang.String
getConnectionString(java.lang.String accountName, java.lang.String accountKey)
static java.lang.String
getConnectionString(java.lang.String accountName, java.lang.String accountKey, java.lang.String blobEndpoint)
static java.lang.String
getConnectionStringForSas(java.lang.String sasUri, java.lang.String blobEndpoint, java.lang.String accountName)
static java.lang.String
getConnectionStringFromProperties(java.util.Properties properties)
static com.microsoft.azure.storage.RetryPolicy
getRetryPolicy(java.lang.String maxRequestRetry)
static java.util.Properties
readConfig(java.lang.String fileName)
Read a configuration properties file.static void
setProxyIfNeeded(java.util.Properties properties)
-
-
-
Field Detail
-
DEFAULT_CONFIG_FILE
public static final java.lang.String DEFAULT_CONFIG_FILE
- See Also:
- Constant Field Values
-
DASH
public static final java.lang.String DASH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBlobClient
public static com.microsoft.azure.storage.blob.CloudBlobClient getBlobClient(@NotNull @NotNull java.lang.String connectionString) throws java.net.URISyntaxException, java.security.InvalidKeyException
Create CloudBlobClient from properties.- Parameters:
connectionString
- connectionString to configure @linkCloudBlobClient
- Returns:
CloudBlobClient
- Throws:
java.net.URISyntaxException
java.security.InvalidKeyException
-
getBlobClient
public static com.microsoft.azure.storage.blob.CloudBlobClient getBlobClient(@NotNull @NotNull java.lang.String connectionString, @Nullable @Nullable com.microsoft.azure.storage.blob.BlobRequestOptions requestOptions) throws java.net.URISyntaxException, java.security.InvalidKeyException
- Throws:
java.net.URISyntaxException
java.security.InvalidKeyException
-
getBlobContainer
public static com.microsoft.azure.storage.blob.CloudBlobContainer getBlobContainer(@NotNull @NotNull java.lang.String connectionString, @NotNull @NotNull java.lang.String containerName) throws DataStoreException
- Throws:
DataStoreException
-
getBlobContainer
public static com.microsoft.azure.storage.blob.CloudBlobContainer getBlobContainer(@NotNull @NotNull java.lang.String connectionString, @NotNull @NotNull java.lang.String containerName, @Nullable @Nullable com.microsoft.azure.storage.blob.BlobRequestOptions requestOptions) throws DataStoreException
- Throws:
DataStoreException
-
setProxyIfNeeded
public static void setProxyIfNeeded(java.util.Properties properties)
-
getRetryPolicy
public static com.microsoft.azure.storage.RetryPolicy getRetryPolicy(java.lang.String maxRequestRetry)
-
getConnectionStringFromProperties
public static java.lang.String getConnectionStringFromProperties(java.util.Properties properties)
-
getConnectionStringForSas
public static java.lang.String getConnectionStringForSas(java.lang.String sasUri, java.lang.String blobEndpoint, java.lang.String accountName)
-
getConnectionString
public static java.lang.String getConnectionString(java.lang.String accountName, java.lang.String accountKey)
-
getConnectionString
public static java.lang.String getConnectionString(java.lang.String accountName, java.lang.String accountKey, java.lang.String blobEndpoint)
-
readConfig
public static java.util.Properties readConfig(java.lang.String fileName) throws java.io.IOException
Read a configuration properties file. If the file name ends with ";burn", the file is deleted after reading.- Parameters:
fileName
- the properties file name- Returns:
- the properties
- Throws:
java.io.IOException
- if the file doesn't exist
-
-