@@ -263,6 +263,8 @@ public static AzureFileSystem GetInstance(string containerName, string rootUrl,
263
263
/// <param name="overrideIfExists">Whether to override the file if it already exists.</param>
264
264
public void AddFile ( string path , Stream stream , bool overrideIfExists )
265
265
{
266
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "AddFile(path, steam, overrideIfExists) method executed with path:{ path } ") ;
267
+
266
268
CloudBlockBlob blockBlob = this . GetBlockBlobReference ( path ) ;
267
269
268
270
if ( blockBlob != null )
@@ -333,6 +335,8 @@ public void AddFile(string path, Stream stream, bool overrideIfExists)
333
335
/// <param name="stream">The <see cref="Stream"/> containing the file contents.</param>
334
336
public void AddFile ( string path , Stream stream )
335
337
{
338
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "AddFile(path, steam) method executed with path:{ path } ") ;
339
+
336
340
this . AddFile ( path , stream , true ) ;
337
341
}
338
342
@@ -353,6 +357,8 @@ public void AddFile(string path, string physicalPath, bool overrideIfExists = tr
353
357
/// </param>
354
358
public void DeleteDirectory ( string path , bool recursive )
355
359
{
360
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "DeleteDirectory(path, recursive) method executed with path:{ path } ") ;
361
+
356
362
path = this . FixPath ( path ) ;
357
363
358
364
if ( ! this . DirectoryExists ( path ) )
@@ -406,6 +412,8 @@ public void DeleteDirectory(string path, bool recursive)
406
412
/// <param name="path">The name of the directory to remove.</param>
407
413
public void DeleteDirectory ( string path )
408
414
{
415
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "DeleteDirectory(path) method executed with path:{ path } ") ;
416
+
409
417
this . DeleteDirectory ( path , false ) ;
410
418
}
411
419
@@ -415,6 +423,8 @@ public void DeleteDirectory(string path)
415
423
/// <param name="path">The name of the file to remove.</param>
416
424
public void DeleteFile ( string path )
417
425
{
426
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "DeleteFile(path) method executed with path:{ path } ") ;
427
+
418
428
CloudBlockBlob blockBlob = this . GetBlockBlobReference ( path ) ;
419
429
420
430
if ( blockBlob != null )
@@ -439,6 +449,8 @@ public void DeleteFile(string path)
439
449
/// </returns>
440
450
public bool DirectoryExists ( string path )
441
451
{
452
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "DirectoryExists(path) method executed with path:{ path } ") ;
453
+
442
454
string fixedPath = this . FixPath ( path ) ;
443
455
CloudBlobDirectory directory = this . cloudBlobContainer . GetDirectoryReference ( fixedPath ) ;
444
456
@@ -454,6 +466,8 @@ public bool DirectoryExists(string path)
454
466
/// </returns>
455
467
public bool FileExists ( string path )
456
468
{
469
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "FileExists(path) method executed with path:{ path } ") ;
470
+
457
471
CloudBlockBlob blockBlobReference = this . GetBlockBlobReference ( path ) ;
458
472
return blockBlobReference ? . Exists ( ) ?? false ;
459
473
}
@@ -467,6 +481,8 @@ public bool FileExists(string path)
467
481
/// </returns>
468
482
public DateTimeOffset GetCreated ( string path )
469
483
{
484
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetCreated(path) method executed with path:{ path } ") ;
485
+
470
486
CloudBlockBlob blockBlob = this . GetBlockBlobReference ( path ) ;
471
487
472
488
if ( blockBlob != null )
@@ -492,6 +508,8 @@ public DateTimeOffset GetCreated(string path)
492
508
/// </returns>
493
509
public IEnumerable < string > GetDirectories ( string path )
494
510
{
511
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetDirectories(path) method executed with path:{ path } ") ;
512
+
495
513
CloudBlobDirectory directory = this . GetDirectoryReference ( path ) ;
496
514
497
515
IEnumerable < IListBlobItem > blobs = directory . ListBlobs ( ) . Where ( blob => blob is CloudBlobDirectory ) . ToList ( ) ;
@@ -510,6 +528,8 @@ public IEnumerable<string> GetDirectories(string path)
510
528
/// </returns>
511
529
public IEnumerable < string > GetFiles ( string path , string filter )
512
530
{
531
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetFiles(path, filter) method executed with path:{ path } & filter { filter } ") ;
532
+
513
533
IEnumerable < IListBlobItem > blobs = this . cloudBlobContainer . ListBlobs ( this . FixPath ( path ) , true ) ;
514
534
515
535
var blobList = blobs as IList < IListBlobItem > ?? blobs . ToList ( ) ;
@@ -550,6 +570,8 @@ public IEnumerable<string> GetFiles(string path, string filter)
550
570
/// </returns>
551
571
public IEnumerable < string > GetFiles ( string path )
552
572
{
573
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetFiles(path) method executed with path:{ path } ") ;
574
+
553
575
return this . GetFiles ( path , "*.*" ) ;
554
576
}
555
577
@@ -562,6 +584,8 @@ public IEnumerable<string> GetFiles(string path)
562
584
/// </returns>
563
585
public string GetFullPath ( string path )
564
586
{
587
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetFullPath(path) method executed with path:{ path } ") ;
588
+
565
589
return this . ResolveUrl ( path , false ) ;
566
590
}
567
591
@@ -574,6 +598,8 @@ public string GetFullPath(string path)
574
598
/// </returns>
575
599
public DateTimeOffset GetLastModified ( string path )
576
600
{
601
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetLastModified(path) method executed with path:{ path } ") ;
602
+
577
603
CloudBlockBlob blockBlob = this . GetBlockBlobReference ( path ) ;
578
604
579
605
if ( blockBlob != null )
@@ -594,6 +620,8 @@ public DateTimeOffset GetLastModified(string path)
594
620
/// </returns>
595
621
public string GetRelativePath ( string fullPathOrUrl )
596
622
{
623
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetRelativePath(path) method executed with fullPathOrUrl:{ fullPathOrUrl } ") ;
624
+
597
625
return this . FixPath ( fullPathOrUrl ) ;
598
626
}
599
627
@@ -607,6 +635,8 @@ public string GetRelativePath(string fullPathOrUrl)
607
635
/// </returns>
608
636
public string GetUrl ( string path )
609
637
{
638
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetUrl(path) method executed with path:{ path } ") ;
639
+
610
640
if ( this . DisableVirtualPathProvider )
611
641
{
612
642
return this . ResolveUrl ( path , false ) ;
@@ -618,6 +648,8 @@ public string GetUrl(string path)
618
648
/// <inheritdoc/>
619
649
public long GetSize ( string path )
620
650
{
651
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetSize(path) method executed with path:{ path } ") ;
652
+
621
653
CloudBlockBlob blockBlob = this . GetBlockBlobReference ( path ) ;
622
654
623
655
if ( blockBlob != null )
@@ -637,6 +669,8 @@ public long GetSize(string path)
637
669
/// </returns>
638
670
public Stream OpenFile ( string path )
639
671
{
672
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "OpenFile(path) method executed with path:{ path } ") ;
673
+
640
674
CloudBlockBlob blockBlob = this . GetBlockBlobReference ( path ) ;
641
675
642
676
if ( blockBlob != null )
@@ -670,6 +704,8 @@ public Stream OpenFile(string path)
670
704
/// <returns>The <see cref="CloudBlobContainer"/></returns>
671
705
public static CloudBlobContainer CreateContainer ( CloudBlobClient cloudBlobClient , string containerName , BlobContainerPublicAccessType accessType )
672
706
{
707
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "CreateContainer(cloudBlobClient, containerName, accessType) method executed with containerName:{ containerName } ") ;
708
+
673
709
containerName = containerName . ToLowerInvariant ( ) ;
674
710
675
711
// Validate container name - from: http://stackoverflow.com/a/23364534/5018
@@ -743,6 +779,8 @@ public static CloudBlobContainer CreateContainer(CloudBlobClient cloudBlobClient
743
779
/// </returns>
744
780
private CloudBlockBlob GetBlockBlobReference ( string path )
745
781
{
782
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetBlockBlobReference(path) method executed with path:{ path } ") ;
783
+
746
784
string blobPath = this . FixPath ( path ) ;
747
785
748
786
// Only make the request if there is an actual path. See issue 8.
@@ -761,6 +799,8 @@ private CloudBlockBlob GetBlockBlobReference(string path)
761
799
/// </returns>
762
800
private CloudBlobDirectory GetDirectoryReference ( string path )
763
801
{
802
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "GetDirectoryReference(path) method executed with path:{ path } ") ;
803
+
764
804
string blobPath = this . FixPath ( path ) ;
765
805
return this . cloudBlobContainer . GetDirectoryReference ( blobPath ) ;
766
806
}
@@ -775,6 +815,8 @@ private CloudBlobDirectory GetDirectoryReference(string path)
775
815
/// </returns>
776
816
private string ResolveUrl ( string path , bool relative )
777
817
{
818
+ Current . Logger . Debug < AzureBlobFileSystem > ( $ "ResolveUrl(path) method executed with path:{ path } ") ;
819
+
778
820
// First create the full url
779
821
string fixedPath = this . FixPath ( path ) ;
780
822
0 commit comments