<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sabeena Kumarawadu on Medium]]></title>
        <description><![CDATA[Stories by Sabeena Kumarawadu on Medium]]></description>
        <link>https://medium.com/@sabeena1217?source=rss-475697a10767------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*S2rk796BB4b9rdLA66up6g.png</url>
            <title>Stories by Sabeena Kumarawadu on Medium</title>
            <link>https://medium.com/@sabeena1217?source=rss-475697a10767------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 06:31:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sabeena1217/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Connecting to Azure Blob | Java]]></title>
            <link>https://medium.com/@sabeena1217/connecting-to-azure-blob-java-99e3246ae8b1?source=rss-475697a10767------2</link>
            <guid isPermaLink="false">https://medium.com/p/99e3246ae8b1</guid>
            <category><![CDATA[upload]]></category>
            <category><![CDATA[download]]></category>
            <category><![CDATA[azure-blob]]></category>
            <category><![CDATA[blob-storage]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Sabeena Kumarawadu]]></dc:creator>
            <pubDate>Thu, 24 Sep 2020 02:22:56 GMT</pubDate>
            <atom:updated>2020-09-24T02:22:56.769Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SonxhjDPnZ9igieZ" /><figcaption>Photo by <a href="https://unsplash.com/@casparrubin?utm_source=medium&amp;utm_medium=referral">Caspar Camille Rubin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you are struggling to connect your java code with the Azure blob storage, then I would guarantee that this blog has everything that you have been looking for.</p><p>Here I have brought you my very own code snippets to list blobs in azure blob storage, download them blobs into your local machine, and moreover to upload files to the blob from your local machine. Let’s jump right into it.</p><h3>Azure Blob Storage?</h3><p>Microsoft Azure offers 4 different options (Blob Storage, File Storage, Table Storage, Queue Storage) to store data on the cloud.</p><p>In Azure blob storage, the files which are known as blobs, are put in containers which function similar to directories. These are then linked to the storage account. Yet these blob files are stored in a plain list without any physical folder structure.</p><h3>Connect to Blob Storage</h3><p>Here I’m using <a href="https://mvnrepository.com/artifact/com.microsoft.azure/azure-storage">Microsoft Azure Storage Client SDK</a> library. Once added the dependency, you are all set to start the job. Also to mention I’m using <a href="https://azure.microsoft.com/en-us/features/storage-explorer/">Azure Storage Explorer</a> to navigate inside the Azure storage.</p><figure><img alt="View on Microsoft Azure Storage Explorer, to get the connection string and the blob container name" src="https://cdn-images-1.medium.com/max/1024/1*v4LrteghtACDB3neeypDyQ.png" /><figcaption>View on Microsoft Azure Storage Explorer, to get the connection string and the blob container name</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b07dfec856ef7805aa2838cdadbb7ae4/href">https://medium.com/media/b07dfec856ef7805aa2838cdadbb7ae4/href</a></iframe><h3>Lists the blobs in the blob container</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/101d78825a04db4004ce02f4714f3f90/href">https://medium.com/media/101d78825a04db4004ce02f4714f3f90/href</a></iframe><h3>Download the blobs</h3><p>To download blobs, I have followed 2 different approaches. First is to iterate through the above list, access the blob with blob name, and write the blob content into a local file,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c8de23cd7bf93c06652491f10319e3a/href">https://medium.com/media/1c8de23cd7bf93c06652491f10319e3a/href</a></iframe><p>Second is to download all the files in the blob, given the blob container name</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5b8df4c19ff893cf454b8deb22dc46f/href">https://medium.com/media/b5b8df4c19ff893cf454b8deb22dc46f/href</a></iframe><h3>Upload files into the blob storage</h3><p>Here I’m trying to upload the files with the same folder structure as in the local machine. That is first I’m going to list the files in the local directory and then upload them into the blob.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/14618baeec81888e825d3404ccaff16f/href">https://medium.com/media/14618baeec81888e825d3404ccaff16f/href</a></iframe><p>One tricky point I wanted to highlight was, if you’re going to build up the path in one go as in <em>line 13, </em>that is not going to work in a Linux environment. The replace did not work. The reason to be find out. Instead separate them into 3 Strings which resolved the trouble.</p><h3>Delete the blobs</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/246337eaae7e8a281bb29c8296cf495f/href">https://medium.com/media/246337eaae7e8a281bb29c8296cf495f/href</a></iframe><p>Soo that’s all about it. The tricky part here is to understand that the blobs reside inside containers, so that you always have to access a blob by its container reference. Hope you will find it useful. Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99e3246ae8b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>