title: Upload directory with sub-directories in java and azure blob storage sdk
body: <p>I use this code for upload files to azure blob storage, but when i try load directory with sub-directories i get error "FileNotFoundException encountered: C:\upload\bin" :(Access is denied), is any solution to load files and directories in source directory?</p>
  
  <pre><code>try {
          CloudStorageAccount account = CloudStorageAccount.parse(storageConnectionString);
          CloudBlobClient serviceClient = account.createCloudBlobClient();
  
          // Container name must be lower case.
          CloudBlobContainer container = serviceClient.getContainerReference(containerName);
          container.createIfNotExists();
          File source = new File(path);
          if (source.list().length &gt; 0) {
              for (File file : source.listFiles()) {
                  CloudBlockBlob blob = container.getBlockBlobReference(file.getName());
                  if (blob.exists() == false) {
                      File sourceFile = new File(source + "\\" + file.getName());
                      blob.upload(new FileInputStream(sourceFile), sourceFile.length());
                      System.out.println("File " + source + "\\" + file.getName() + " Load to blob storage");
                  } else System.out.println("File " + source + "\\" + file.getName() + " Already exist in storage");
              }
          } else System.out.println("In folder " + path + " are no files ");
      } catch (FileNotFoundException fileNotFoundException) {
          System.out.print("FileNotFoundException encountered: ");
          System.out.println(fileNotFoundException.getMessage());
          System.exit(-1);
  
      } catch (StorageException storageException) {
          System.out.print("StorageException encountered: ");
          System.out.println(storageException.getMessage());
          System.exit(-1);
      } catch (Exception e) {
          System.out.print("Exception encountered: ");
          System.out.println(e.getMessage());
          System.exit(-1);
      }
  </code></pre>