Class AzureFileStorage

    • 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

      • fetchFile

        public boolean fetchFile​(String digest,
                                 File file)
                          throws IOException
        Description copied from interface: FileStorage
        Fetches a file based on its key.
        Specified by:
        fetchFile in interface FileStorage
        Parameters:
        digest - the file key
        file - the file to use to store the fetched data
        Returns:
        true if the file was fetched, false if the file was not found
        Throws:
        IOException - if a storage error occurred
      • exists

        public boolean exists​(String digest)
        Description copied from interface: FileStorage
        Does 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:
        exists in interface FileStorage
        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)
      • isBlobDigestCorrect

        protected static boolean isBlobDigestCorrect​(String digest,
                                                     String contentMD5)
      • decodeContentMD5

        protected static String decodeContentMD5​(String contentMD5)