Esempio n. 1
0
 private static void AssertMetaDataExists(LocalMetaData blobMetaData)
 {
     if (blobMetaData == null)
     {
         throw new InvalidOperationException("There is no CsUpload metadata on the blob, so CsUpload cannot resume. Use the overwrite option.");
     }
 }
Esempio n. 2
0
 public static void SetUploadMetaData(this CloudPageBlob blob, LocalMetaData metaData)
 {
     if (metaData == null)
     {
         throw new ArgumentNullException("metaData");
     }
     blob.Metadata[LocalMetaData.MetaDataKey] = SerializationUtil.GetSerializedString(metaData);
 }
Esempio n. 3
0
        private static void AssertMetaDataMatch(LocalMetaData blobMetaData, LocalMetaData localMetaData)
        {
            var systemInformation = blobMetaData.SystemInformation;

            if (String.Compare(systemInformation.MachineName, Environment.MachineName, CultureInfo.InvariantCulture, CompareOptions.IgnoreCase) != 0)
            {
                var message = String.Format("An upload is already in progress on machine {0} with process id {1}",
                                            systemInformation.MachineName,
                                            systemInformation.CsUploadProcessId);

                throw new InvalidOperationException(message);
            }

            var fileMetaDataMessages = CompareFileMetaData(blobMetaData.FileMetaData, localMetaData.FileMetaData);

            if (fileMetaDataMessages.Count > 0)
            {
                throw new InvalidOperationException(fileMetaDataMessages.Aggregate((r, n) => r + Environment.NewLine + n));
            }
        }
        private static void AssertMetaDataMatch(LocalMetaData blobMetaData, LocalMetaData localMetaData)
        {
            var systemInformation = blobMetaData.SystemInformation;

            if (String.Compare(systemInformation.MachineName, Environment.MachineName, CultureInfo.InvariantCulture, CompareOptions.IgnoreCase) != 0)
            {
                var message = String.Format("An upload is already in progress on machine {0} with process id {1}",
                                            systemInformation.MachineName,
                                            systemInformation.CsUploadProcessId);

                throw new InvalidOperationException(message);
            }

            var fileMetaDataMessages = CompareFileMetaData(blobMetaData.FileMetaData, localMetaData.FileMetaData);

            if (fileMetaDataMessages.Count > 0)
            {
                throw new InvalidOperationException(fileMetaDataMessages.Aggregate((r,n)=>r + Environment.NewLine + n));
            }
        }
 private static void AssertMetaDataExists(LocalMetaData blobMetaData)
 {
     if(blobMetaData == null)
     {
         throw new InvalidOperationException("There is no CsUpload metadata on the blob, so CsUpload cannot resume. Use the overwrite option.");
     }
 }