Revision 8fb25a1b asi-http-request-with-pithos/Classes/Pithos/ASIPithos.m
b/asi-http-request-with-pithos/Classes/Pithos/ASIPithos.m | ||
---|---|---|
38 | 38 |
#import "ASIPithosRequest.h" |
39 | 39 |
|
40 | 40 |
@implementation ASIPithos |
41 |
@synthesize authURL, authUser, authKey, storageURLPrefix, storageURL, authToken, publicURLPrefix, userCatalogURL;
|
|
41 |
@synthesize authToken, authUser, ignoreSSLErrors, tokensURL, storageURLPrefix, userCatalogURL, publicURLPrefix, storageURL;
|
|
42 | 42 |
|
43 | 43 |
#pragma mark - Object Lifecycle |
44 | 44 |
|
... | ... | |
48 | 48 |
} |
49 | 49 |
|
50 | 50 |
- (NSString *)description { |
51 |
return [NSString stringWithFormat:@"authURL: %@, authUser: %@, authKey: %@, storageURLPrefix: %@, storageURL: %@, authToken: %@, publicURLPrefix: %@, userCatalogURL: %@",
|
|
52 |
authURL, authUser, authKey, storageURLPrefix, storageURL, authToken, publicURLPrefix, userCatalogURL];
|
|
51 |
return [NSString stringWithFormat:@"authToken: %@, authUser: %@, ignoreSSLErrors: %d, tokensURL: %@, storageURLPrefix: %@, userCatalogURL: %@, publicURLPrefix: %@",
|
|
52 |
authToken, authUser, ignoreSSLErrors, tokensURL, storageURLPrefix, userCatalogURL, publicURLPrefix];
|
|
53 | 53 |
} |
54 | 54 |
|
55 |
|
|
56 | 55 |
#pragma mark - Properties |
57 | 56 |
|
58 |
- (NSString *)storageURL { |
|
59 |
if (storageURL) |
|
60 |
return storageURL; |
|
61 |
else if (storageURLPrefix && authUser) |
|
62 |
return [NSString stringWithFormat:@"%@/%@", storageURLPrefix, [ASIPithosRequest encodeToPercentEscape:authUser]]; |
|
63 |
return nil; |
|
64 |
} |
|
65 |
|
|
66 | 57 |
- (NSString *)storageURLWithAuthUser:(NSString *)anAuthUser { |
67 |
if (storageURLPrefix) |
|
58 |
if (storageURLPrefix && anAuthUser)
|
|
68 | 59 |
return [NSString stringWithFormat:@"%@/%@", storageURLPrefix, [ASIPithosRequest encodeToPercentEscape:anAuthUser]]; |
69 | 60 |
return nil; |
70 | 61 |
} |
71 | 62 |
|
63 |
- (NSString *)storageURL { |
|
64 |
return [self storageURLWithAuthUser:authUser]; |
|
65 |
} |
|
66 |
|
|
72 | 67 |
@end |
Also available in: Unified diff