Revision b9ebc0f4 asi-http-request-with-pithos/Classes/Pithos/ASIPithosContainerRequest.m
b/asi-http-request-with-pithos/Classes/Pithos/ASIPithosContainerRequest.m | ||
---|---|---|
338 | 338 |
return request; |
339 | 339 |
} |
340 | 340 |
|
341 |
// POST storageURL/container?[update=] (update data from ASIPithosObject with data) |
|
342 |
+ (id)updateContainerDataRequestWithContainerName:(NSString *)containerName |
|
343 |
policy:(NSDictionary *)policy |
|
344 |
metadata:(NSDictionary *)metadata |
|
345 |
update:(BOOL)update |
|
346 |
object:(ASIPithosObject *)object { |
|
347 |
return [self updateContainerDataRequestWithContainerName:containerName |
|
348 |
policy:policy |
|
349 |
metadata:metadata |
|
350 |
update:update |
|
351 |
data:object.data]; |
|
352 |
} |
|
353 |
|
|
354 |
// POST storageURL/container?[update=] (update data from NSData) |
|
355 |
+ (id)updateContainerDataRequestWithContainerName:(NSString *)containerName |
|
356 |
policy:(NSDictionary *)policy |
|
357 |
metadata:(NSDictionary *)metadata |
|
358 |
update:(BOOL)update |
|
359 |
data:(NSData *)data { |
|
360 |
ASIPithosContainerRequest *request = [self updateContainerMetadataRequestWithContainerName:containerName |
|
361 |
policy:policy |
|
362 |
metadata:metadata |
|
363 |
update:update]; |
|
364 |
[request addRequestHeader:@"Content-Type" value:@"application/octet-stream"]; |
|
365 |
[request appendPostData:data]; |
|
366 |
return request; |
|
367 |
} |
|
368 |
|
|
369 |
// POST storageURL/container?[update=] (update data from file) |
|
370 |
+ (id)updateContainerDataRequestWithContainerName:(NSString *)containerName |
|
371 |
policy:(NSDictionary *)policy |
|
372 |
metadata:(NSDictionary *)metadata |
|
373 |
update:(BOOL)update |
|
374 |
file:(NSString *)filePath { |
|
375 |
ASIPithosContainerRequest *request = [self updateContainerMetadataRequestWithContainerName:containerName |
|
376 |
policy:policy |
|
377 |
metadata:metadata |
|
378 |
update:update]; |
|
379 |
[request addRequestHeader:@"Content-Type" value:@"application/octet-stream"]; |
|
380 |
request.shouldStreamPostDataFromDisk = YES; |
|
381 |
request.postBodyFilePath = filePath; |
|
382 |
return request; |
|
383 |
} |
|
384 |
|
|
341 | 385 |
#pragma mark - |
342 | 386 |
#pragma mark DELETE |
343 | 387 |
|
Also available in: Unified diff