Exemplo n.º 1
0
        public static BlobStream getBlobReadStream(string containerName, string blobName)
        {
            /**** set up the blob for reading ****/
            string             baseUri       = "";
            CloudBlobContainer blobContainer = BlobLibrary.initContainer(containerName, ref baseUri);

            if (!BlobLibrary.Exists(blobContainer))
            {
                return(null);
            }

            string    blobUriPath = blobName; // could also use paths, as in: “images/” + fileInfo.Name;
            CloudBlob blob        = blobContainer.GetBlobReference(blobUriPath);

            if (!BlobLibrary.Exists(blob))
            {
                return(null);
            }
            return(blob.OpenRead());
        }
Exemplo n.º 2
0
        public static bool Exists(string containerName, string blobName)
        {
            /**** init blob ****/
            string             baseUri       = "";
            CloudBlobContainer blobContainer = BlobLibrary.initContainer(containerName, ref baseUri);

            if (!BlobLibrary.Exists(blobContainer))
            {
                return(false);
            }

            string    blobUriPath = blobName; // could also use paths, as in: “images/” + fileInfo.Name;
            CloudBlob blob        = blobContainer.GetBlobReference(blobUriPath);

            if (!BlobLibrary.Exists(blob))
            {
                return(false);
            }

            return(true);
        }