示例#1
0
        // Build upload request for updating metadata for existing file
        private UploadMetaDataRequest buildUploadMetaDataRequest(FileMetaData metadata)
        {
            if (metadata == null ||
                metadata.id == null)
            {
                throw new KinveyException(EnumErrorCategory.ERROR_FILE, EnumErrorCode.ERROR_FILE_UPLOAD_MISSING_METADATA_INFORMATION, "");
            }

            var urlParameters = new Dictionary <string, string>();

            urlParameters.Add("appKey", ((KinveyClientRequestInitializer)client.RequestInitializer).AppKey);
            urlParameters.Add("fileID", metadata.id);

            UploadMetaDataRequest uploadMetaDataRequest = new UploadMetaDataRequest(metadata, urlParameters, this.client);

            client.InitializeRequest(uploadMetaDataRequest);
            uploadMetaDataRequest.customRequestHeaders = this.GetCustomRequestProperties();

            return(uploadMetaDataRequest);
        }
示例#2
0
 internal UploadMetaDataRequest(FileMetaData meta, Dictionary <string, string> urlProperties, AbstractClient client)
     : base(client, "PUT", REST_PATH, meta, urlProperties)
 {
     this.fileID = urlProperties["fileID"];
 }
示例#3
0
 public async Task <FileMetaData> downloadAsync(FileMetaData metadata, Stream content, CancellationToken ct = default(CancellationToken))
 {
     return(await DownloadAsync(metadata, content, ct));
 }
示例#4
0
 public async Task <FileMetaData> downloadAsync(FileMetaData metadata, byte[] content, CancellationToken ct = default(CancellationToken))
 {
     return(await DownloadAsync(metadata, content, ct).ConfigureAwait(false));
 }