Skip to content
Browse files

added new method to import nsdata for url

  • Loading branch information...
1 parent d1d2319 commit 99dad16b59befe3bf9edec7db404510163468ae4 Sebastian Grimme committed Oct 29, 2013
Showing with 10 additions and 1 deletion.
  1. +1 −1 src/shared/AFCache+Packaging.h
  2. +9 −0 src/shared/AFCache+Packaging.m
View
2 src/shared/AFCache+Packaging.h
@@ -13,8 +13,8 @@
@interface AFCache (Packaging)
-
- (BOOL)importCacheableItem:(AFCacheableItem*)cacheableItem withData:(NSData*)theData;
+- (AFCacheableItem *)importObjectForURL:(NSURL *)url data:(NSData *)data;
- (AFCacheableItem *)requestPackageArchive: (NSURL *) url delegate: (id) aDelegate;
- (AFCacheableItem *)requestPackageArchive: (NSURL *) url delegate: (id) aDelegate username: (NSString*) username password: (NSString*) password;
- (void)packageArchiveDidFinishLoading: (AFCacheableItem *) cacheableItem;
View
9 src/shared/AFCache+Packaging.m
@@ -321,6 +321,15 @@ - (BOOL)importCacheableItem:(AFCacheableItem*)cacheableItem withData:(NSData*)th
return YES;
}
+- (AFCacheableItem *)importObjectForURL:(NSURL *)url data:(NSData *)data
+{
+ AFCacheableItem *item = [[AFCacheableItem alloc] initWithURL:url lastModified:[NSDate date] expireDate:nil];
+
+ [self importCacheableItem:item withData:data];
+
+ return [item autorelease];
+}
+
- (void)purgeCacheableItemForURL:(NSURL*)url {
AFCacheableItemInfo *cacheableItemInfo = [CACHED_OBJECTS valueForKey:[url absoluteString]];
[self removeCacheEntry:cacheableItemInfo fileOnly:NO];

0 comments on commit 99dad16

Please sign in to comment.
Something went wrong with that request. Please try again.