Class AzureStorageBlobProtocolResolver
java.lang.Object
com.azure.spring.cloud.core.resource.AbstractAzureStorageProtocolResolver
com.azure.spring.cloud.core.resource.AzureStorageBlobProtocolResolver
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.context.ResourceLoaderAware, org.springframework.core.io.ProtocolResolver, org.springframework.core.io.ResourceLoader, org.springframework.core.io.support.ResourcePatternResolver
A
ProtocolResolver implementation for the azure-blob:// protocol.-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractAzureStorageProtocolResolver
AbstractAzureStorageProtocolResolver.StorageContainerClient, AbstractAzureStorageProtocolResolver.StorageContainerItem, AbstractAzureStorageProtocolResolver.StorageItem -
Field Summary
Fields inherited from class AbstractAzureStorageProtocolResolver
beanFactory, matcherFields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIXFields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet StorageContainerClient with specified container name.protected org.springframework.core.io.ResourcegetStorageResource(String location, Boolean autoCreate) Get Resource from resource location.protected StorageTypeThe storageType of current protocolResolver.listStorageContainers(String containerPrefix) List all storage containers.Methods inherited from class AbstractAzureStorageProtocolResolver
getClassLoader, getMatchedContainers, getMatchedItems, getResource, getResources, postProcessBeanFactory, resolve, resolveResources, setResourceLoader
-
Constructor Details
-
AzureStorageBlobProtocolResolver
public AzureStorageBlobProtocolResolver()Creates an instance ofAzureStorageBlobProtocolResolver.
-
-
Method Details
-
getStorageType
The storageType of current protocolResolver.- Specified by:
getStorageTypein classAbstractAzureStorageProtocolResolver- Returns:
- StorageType.BLOB;
-
listStorageContainers
protected Stream<AbstractAzureStorageProtocolResolver.StorageContainerItem> listStorageContainers(String containerPrefix) Description copied from class:AbstractAzureStorageProtocolResolverList all storage containers.The underlying storage system may support 'prefix' filter, for example, Azure Storage Blob supports this
https://docs.microsoft.com/rest/api/storageservices/list-blobs
In this case, we can avoid load all containers to do client side filtering.
- Specified by:
listStorageContainersin classAbstractAzureStorageProtocolResolver- Parameters:
containerPrefix- container name prefix, without any wildcard characters.- Returns:
- All storage containers match the given prefix, or all containers if the underlying storage system doesn't support prefix match.
-
getStorageContainerClient
protected AbstractAzureStorageProtocolResolver.StorageContainerClient getStorageContainerClient(String name) Description copied from class:AbstractAzureStorageProtocolResolverGet StorageContainerClient with specified container name.- Specified by:
getStorageContainerClientin classAbstractAzureStorageProtocolResolver- Parameters:
name- Container name- Returns:
- the storage container client.
-
getStorageResource
protected org.springframework.core.io.Resource getStorageResource(String location, Boolean autoCreate) Description copied from class:AbstractAzureStorageProtocolResolverGet Resource from resource location.- Specified by:
getStorageResourcein classAbstractAzureStorageProtocolResolver- Parameters:
location- The specified resource location.autoCreate- Whether to auto-create the resource if the resource is not exist.- Returns:
- the storage
Resource.
-