Implemented MIMETypeForPathExtension for NSURL and NSString. refs #409

Refactored duplicated code for returning the MIME Type based on file path extension using
Core Services UTI.
This commit is contained in:
Blake Watters
2011-10-16 02:04:00 -04:00
parent 0e08147d5b
commit 585d4aafc8
8 changed files with 64 additions and 45 deletions

View File

@@ -21,6 +21,7 @@
#import "NSURL+RestKit.h"
#import "NSDictionary+RKAdditions.h"
#import "RKFixCategoryBug.h"
#import "NSString+RestKit.h"
RK_FIX_CATEGORY_BUG(NSURL_RestKit)
@@ -30,4 +31,8 @@ RK_FIX_CATEGORY_BUG(NSURL_RestKit)
return [NSDictionary dictionaryWithURLEncodedString:self.query];
}
- (NSString *)MIMETypeForPathExtension {
return [[self path] MIMETypeForPathExtension];
}
@end