Revision 64929bae Classes/StorageObject.m

b/Classes/StorageObject.m
58 58
    
59 59
    object.name = [dict objectForKey:@"name"]; // this may be shortened by folder parsing later
60 60
    object.fullPath = [dict objectForKey:@"name"];
61
    object.hash = [dict objectForKey:@"hash"];
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 64
    object.lastModified = [ComputeModel dateFromString:[dict objectForKey:@"last_modified"]];
......
77 77
    return object;
78 78
}
79 79

  
80
- (void)setPropertiesfromResponseHeaders:(NSDictionary *)headers {
81
    self.hash = [headers objectForKey:@"X-Object-Hash"];
82
    self.bytes = [[headers objectForKey:@"Content-Length"] intValue];
83
    self.contentType = [headers objectForKey:@"Content-Type"];
84
    self.lastModified = [headers objectForKey:@"Last-Modified"];
85
    self.publicURI = [headers objectForKey:@"X-Object-Public"];
86
    self.sharing = [headers objectForKey:@"X-Object-Sharing"];
87
    
88
    self.metadata = [NSMutableDictionary dictionary];
89
    for (NSString *key in headers) {
90
        if ([key hasPrefix:@"X-Object-Meta-"]) {
91
            NSString *metadataValue = [headers objectForKey:key];
92
            NSString *metadataKey = [key substringFromIndex:14];
93
            [self.metadata setObject:metadataValue forKey:metadataKey];
94
        }
95
    }
96
}
97

  
80 98
#pragma mark -
81 99
#pragma mark Presentation
82 100

  

Also available in: Unified diff