Exemple #1
0
 public void Dispose()
 {
     if (_upload != null)
     {
         _upload.Dispose();
         _upload = null;
     }
 }
        internal UploadOperation(Stream stream, SWIG.UplinkUploadResult uploadResult, string objectName, CustomMetadata customMetadata = null)
        {
            _byteStreamToUpload = stream;
            _upload             = uploadResult.upload;
            ObjectName          = objectName;
            _customMetadata     = customMetadata;

            if (uploadResult.error != null && !string.IsNullOrEmpty(uploadResult.error.message))
            {
                _errorMessage = uploadResult.error.message;
                Failed        = true;
                Running       = false;
            }
        }
 internal void ToSWIG(SWIG.UplinkUpload upload)
 {
     if (CustomMetadata != null)
     {
         UploadOperation.customMetadataSemaphore.Wait();
         try
         {
             CustomMetadata.ToSWIG(); //Appends the customMetadata in the go-layer to a global field
             using (SWIG.UplinkError customMetadataError = SWIG.storj_uplink.upload_set_custom_metadata2(upload))
             {
                 if (customMetadataError != null && !string.IsNullOrEmpty(customMetadataError.message))
                 {
                     throw new SetCustomMetadataFailedException(customMetadataError.message);
                 }
             }
         }
         finally
         {
             UploadOperation.customMetadataSemaphore.Release();
         }
     }
 }
Exemple #4
0
 internal ChunkedUploadOperation(SWIG.UplinkUploadResult uploadResult, string objectName, CustomMetadata customMetadata = null)
 {
     _upload         = uploadResult.upload;
     _objectName     = objectName;
     _customMetadata = customMetadata;
 }