Revision 29cc4957 Classes/StorageObject.m
b/Classes/StorageObject.m | ||
---|---|---|
13 | 13 |
|
14 | 14 |
@implementation StorageObject |
15 | 15 |
|
16 |
@synthesize name, fullPath, hash, bytes, contentType, lastModified, data, publicURI, sharing, metadata; |
|
16 |
@synthesize name, fullPath, hash, bytes, contentType, lastModified, data, publicURI, sharing, metadata, iso8601DateString, lastModifiedString;
|
|
17 | 17 |
|
18 | 18 |
#pragma mark - |
19 | 19 |
#pragma mark Serialization |
... | ... | |
61 | 61 |
object.hash = [dict objectForKey:@"x_object_hash"]; |
62 | 62 |
object.bytes = [[dict objectForKey:@"bytes"] intValue]; |
63 | 63 |
object.contentType = [dict objectForKey:@"content_type"]; |
64 |
object.lastModified = [ComputeModel dateFromString:[dict objectForKey:@"last_modified"]]; |
|
64 |
//object.lastModified = [ComputeModel dateFromString:[dict objectForKey:@"last_modified"]]; |
|
65 |
object.iso8601DateString = [dict objectForKey:@"last_modified"]; |
|
65 | 66 |
object.publicURI = [dict objectForKey:@"x_object_public"]; |
66 | 67 |
object.sharing = [dict objectForKey:@"x_object_sharing"]; |
67 | 68 |
object.metadata = nil; |
... | ... | |
123 | 124 |
} |
124 | 125 |
|
125 | 126 |
#pragma mark - |
127 |
#pragma mark Properties |
|
128 |
|
|
129 |
- (NSString *)lastModifiedString { |
|
130 |
if (!lastModifiedString) { |
|
131 |
if (!self.lastModified && [self.iso8601DateString length]) |
|
132 |
self.lastModified = [ComputeModel dateFromString:self.iso8601DateString]; |
|
133 |
if (self.lastModified) |
|
134 |
lastModifiedString = [[ComputeModel localDateDescriptionFromDate:self.lastModified] retain]; |
|
135 |
} |
|
136 |
return lastModifiedString; |
|
137 |
} |
|
138 |
|
|
139 |
#pragma mark - |
|
126 | 140 |
#pragma mark Memory Management |
127 | 141 |
|
128 | 142 |
-(void)dealloc { |
... | ... | |
133 | 147 |
[lastModified release]; |
134 | 148 |
[data release]; |
135 | 149 |
[metadata release]; |
150 |
[iso8601DateString release]; |
|
151 |
[lastModifiedString release]; |
|
136 | 152 |
[super dealloc]; |
137 | 153 |
} |
138 | 154 |
|
Also available in: Unified diff