public class AzureFileStorage extends Object implements FileStorage
Modifier and Type | Field and Description |
---|---|
protected com.microsoft.azure.storage.blob.CloudBlobContainer |
container |
Constructor and Description |
---|
AzureFileStorage(com.microsoft.azure.storage.blob.CloudBlobContainer container) |
Modifier and Type | Method and Description |
---|---|
protected static String |
decodeContentMD5(String contentMD5) |
boolean |
fetchFile(String digest,
File file)
Fetches a file based on its key.
|
protected static boolean |
isBlobDigestCorrect(String digest,
com.microsoft.azure.storage.blob.CloudBlockBlob blob) |
protected static boolean |
isBlobDigestCorrect(String digest,
String contentMD5) |
protected static boolean |
isMissingKey(com.microsoft.azure.storage.StorageException e) |
void |
storeFile(String digest,
File file)
Stores a file based on a key.
|
protected com.microsoft.azure.storage.blob.CloudBlobContainer container
public AzureFileStorage(com.microsoft.azure.storage.blob.CloudBlobContainer container)
public void storeFile(String digest, File file) throws IOException
FileStorage
storeFile
in interface FileStorage
digest
- the file keyfile
- the fileIOException
- if a storage error occurredpublic boolean fetchFile(String digest, File file) throws IOException
FileStorage
fetchFile
in interface FileStorage
digest
- the file keyfile
- the file to use to store the fetched datatrue
if the file was fetched, false
if the file was not foundIOException
- if a storage error occurredprotected static boolean isMissingKey(com.microsoft.azure.storage.StorageException e)
protected static boolean isBlobDigestCorrect(String digest, com.microsoft.azure.storage.blob.CloudBlockBlob blob)
protected static boolean isBlobDigestCorrect(String digest, String contentMD5)
protected static String decodeContentMD5(String contentMD5)
Copyright © 2018 Nuxeo. All rights reserved.