CreateContainer() 공개 메소드

public CreateContainer ( ) : void
리턴 void
예제 #1
0
        private bool _handleWebException(CloudBlob blob, WebException err)
        {
            var response = (HttpWebResponse)err.Response;

            if (response.StatusCode == HttpStatusCode.NotFound)
            {
                _azureDirectory.CreateContainer();
                blob.UploadText(_lockFile);
                return(true);
            }
            return(false);
        }
예제 #2
0
 private bool _handleWebException(ICloudBlob blob, StorageException err)
 {
     if (err.RequestInformation.HttpStatusCode == 404 || err.RequestInformation.HttpStatusCode == 409)
     {
         _azureDirectory.CreateContainer();
         using (var stream = new MemoryStream())
             using (var writer = new StreamWriter(stream))
             {
                 writer.Write(_lockFile);
                 blob.UploadFromStream(stream);
             }
         return(true);
     }
     return(false);
 }
예제 #3
0
 private bool _handleWebException(BlobClient blob, RequestFailedException err)
 {
     if (err.Status == 404)
     {
         _azureDirectory.CreateContainer();
         using (var stream = new MemoryStream())
             using (var writer = new StreamWriter(stream))
             {
                 writer.Write(_lockFile);
                 blob.Upload(stream);
             }
         return(true);
     }
     return(false);
 }