Revision 9ab4b378 pithos-macos/PithosUtilities.m

b/pithos-macos/PithosUtilities.m
141 141
    }
142 142
    
143 143
    for (ASIPithosObject *object in objects) {
144
        if ([object.contentType isEqualToString:@"application/directory"]) {
144
        if ([PithosUtilities isContentTypeDirectory:object.contentType]) {
145 145
            NSString *subdirDirectoryPath = [directoryPath stringByAppendingPathComponent:subdirName];
146 146
            subdirDirectoryPath = [subdirDirectoryPath stringByAppendingPathComponent:[object.name substringFromIndex:subdirPrefixLength]];
147 147
            
......
840 840
    return [response MIMEType];
841 841
}
842 842

  
843
// Returns if an object is a directory based on its content type
844
+ (BOOL)isContentTypeDirectory:(NSString *)contentType {
845
    return ([contentType isEqualToString:@"application/directory"] ||
846
            [contentType hasPrefix:@"application/directory;"] ||
847
            [contentType isEqualToString:@"application/folder"] ||
848
            [contentType hasPrefix:@"application/folder;"]);
849
}
850

  
843 851
// Returns if an object exists at the given container/object path and if this object is an application/directory
844 852
// If an error occured an alert is shown and it is returned so the caller won't proceed
845 853
+ (BOOL)objectExistsAtContainerName:(NSString *)containerName objectName:(NSString *)objectName 
......
858 866
        [self httpRequestErrorAlertWithRequest:objectRequest];
859 867
        return NO;
860 868
    } else if (objectRequest.responseStatusCode == 200) {
861
        *isDirectory = [[objectRequest contentType] isEqualToString:@"application/directory"];
869
        *isDirectory = [self isContentTypeDirectory:[objectRequest contentType]];
862 870
        return YES;
863 871
    }
864 872
    return NO;

Also available in: Unified diff