Class AzureStorageFileProtocolResolver
java.lang.Object
com.azure.spring.cloud.core.resource.AbstractAzureStorageProtocolResolver
com.azure.spring.cloud.core.resource.AzureStorageFileProtocolResolver
- 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-file:// protocol.-
Nested Class Summary
Nested classes/interfaces inherited from class com.azure.spring.cloud.core.resource.AbstractAzureStorageProtocolResolver
AbstractAzureStorageProtocolResolver.StorageContainerClient, AbstractAzureStorageProtocolResolver.StorageContainerItem, AbstractAzureStorageProtocolResolver.StorageItem -
Field Summary
Fields inherited from class com.azure.spring.cloud.core.resource.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 com.azure.spring.cloud.core.resource.AbstractAzureStorageProtocolResolver
getClassLoader, getMatchedContainers, getMatchedItems, getResource, getResources, postProcessBeanFactory, resolve, resolveResources, setResourceLoader
-
Constructor Details
-
AzureStorageFileProtocolResolver
public AzureStorageFileProtocolResolver()
-
-
Method Details
-
getStorageType
The storageType of current protocolResolver.- Specified by:
getStorageTypein classAbstractAzureStorageProtocolResolver- Returns:
- StorageType.FILE;
-
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.
-