Revision cfc17d33 pithos-macos/PithosUtilities.m
b/pithos-macos/PithosUtilities.m | ||
---|---|---|
51 | 51 |
+ (ASIPithosObjectRequest *)objectDataRequestWithPithos:(ASIPithos *)pithos |
52 | 52 |
containerName:(NSString *)containerName |
53 | 53 |
objectName:(NSString *)objectName |
54 |
version:(NSString *)version |
|
54 | 55 |
toDirectory:(NSString *)directoryPath |
56 |
withNewFileName:(NSString *)newFileName |
|
55 | 57 |
checkIfExists:(BOOL)ifExists |
56 | 58 |
sharingAccount:(NSString *)sharingAccount { |
57 |
NSString *fileName = [objectName lastPathComponent]; |
|
58 |
if([objectName hasSuffix:@"/"]) |
|
59 |
fileName = [fileName stringByAppendingString:@"/"]; |
|
59 |
NSString *fileName; |
|
60 |
if (newFileName) { |
|
61 |
fileName = [NSString stringWithString:newFileName]; |
|
62 |
} else { |
|
63 |
fileName = [objectName lastPathComponent]; |
|
64 |
if ([objectName hasSuffix:@"/"]) |
|
65 |
fileName = [fileName stringByAppendingString:@"/"]; |
|
66 |
} |
|
60 | 67 |
fileName = [fileName stringByReplacingOccurrencesOfString:@"/" withString:@":"]; |
61 | 68 |
|
62 | 69 |
NSFileManager *fileManager = [NSFileManager defaultManager]; |
... | ... | |
93 | 100 |
|
94 | 101 |
ASIPithosObjectRequest *objectRequest = [ASIPithosObjectRequest objectDataRequestWithPithos:pithos |
95 | 102 |
containerName:containerName |
96 |
objectName:objectName]; |
|
103 |
objectName:objectName |
|
104 |
version:version]; |
|
97 | 105 |
if (sharingAccount) |
98 | 106 |
[objectRequest setRequestUserFromDefaultTo:sharingAccount withPithos:pithos]; |
99 | 107 |
objectRequest.downloadDestinationPath = destinationPath; |
... | ... | |
187 | 195 |
ASIPithosObjectRequest *objectRequest = [self objectDataRequestWithPithos:pithos |
188 | 196 |
containerName:containerName |
189 | 197 |
objectName:object.name |
198 |
version:nil |
|
190 | 199 |
toDirectory:objectDirectoryPath |
200 |
withNewFileName:nil |
|
191 | 201 |
checkIfExists:NO |
192 | 202 |
sharingAccount:sharingAccount]; |
193 | 203 |
[(NSMutableDictionary *)objectRequest.userInfo setObject:[NSNumber numberWithUnsignedInteger:object.bytes] forKey:@"bytes"]; |
Also available in: Unified diff