public Lease GetLease(string pathToFile, string blobSasUri) { if (!string.IsNullOrWhiteSpace(blobSasUri)) { return(BlobLease.GetLease(pathToFile, blobSasUri)); } else { return(FileLease.GetLease(pathToFile)); } }
public Lease TryGetLease(string pathToFile, string blobSasUri) { try { if (!string.IsNullOrWhiteSpace(blobSasUri)) { return(BlobLease.TryGetLease(pathToFile, blobSasUri)); } else { return(FileLease.TryGetLease(pathToFile)); } } catch (Exception e) { Console.WriteLine("Could not get the lease to " + pathToFile); Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); return(null); } }