Package org.nuxeo.ecm.blob.azure
Class AzureFileStorage
- java.lang.Object
-
- org.nuxeo.ecm.blob.azure.AzureFileStorage
-
- All Implemented Interfaces:
FileStorage
public class AzureFileStorage extends Object implements FileStorage
- Since:
- 7.10
- Author:
- Arnaud Kervern
-
-
Constructor Summary
Constructors Constructor Description AzureFileStorage(com.microsoft.azure.storage.blob.CloudBlobContainer container, String prefix)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static StringdecodeContentMD5(String contentMD5)booleanexists(String digest)Does a blob with the given key exist in the storage.booleanfetchFile(String digest, File file)Fetches a file based on its key.protected static booleanisBlobDigestCorrect(String digest, com.microsoft.azure.storage.blob.CloudBlockBlob blob)protected static booleanisBlobDigestCorrect(String digest, String contentMD5)protected static booleanisMissingKey(com.microsoft.azure.storage.StorageException e)voidstoreFile(String digest, File file)Stores a file based on a key.
-
-
-
Field Detail
-
container
protected com.microsoft.azure.storage.blob.CloudBlobContainer container
-
prefix
protected String prefix
-
-
Constructor Detail
-
AzureFileStorage
public AzureFileStorage(com.microsoft.azure.storage.blob.CloudBlobContainer container, String prefix)
-
-
Method Detail
-
storeFile
public void storeFile(String digest, File file) throws IOException
Description copied from interface:FileStorageStores a file based on a key.- Specified by:
storeFilein interfaceFileStorage- Parameters:
digest- the file keyfile- the file- Throws:
IOException- if a storage error occurred
-
fetchFile
public boolean fetchFile(String digest, File file) throws IOException
Description copied from interface:FileStorageFetches a file based on its key.- Specified by:
fetchFilein interfaceFileStorage- Parameters:
digest- the file keyfile- the file to use to store the fetched data- Returns:
trueif the file was fetched,falseif the file was not found- Throws:
IOException- if a storage error occurred
-
exists
public boolean exists(String digest)
Description copied from interface:FileStorageDoes a blob with the given key exist in the storage.The existence of the blob is checked in the storage where the blob is effectively stored. Intermediate cache is ignored.
- Specified by:
existsin interfaceFileStorage- Parameters:
digest- the blob key- Returns:
- true if it exists in the storage
-
isMissingKey
protected static boolean isMissingKey(com.microsoft.azure.storage.StorageException e)
-
isBlobDigestCorrect
protected static boolean isBlobDigestCorrect(String digest, com.microsoft.azure.storage.blob.CloudBlockBlob blob)
-
-