Repository: artifacts/AFCache Branch: master Commit: 70dec2bd449f Files: 145 Total size: 748.1 KB Directory structure: gitextract_tdvd3mfz/ ├── .gitignore ├── AFCache-iOS.xcodeproj/ │ └── project.pbxproj ├── AFCache.podspec ├── AFCache.xcodeproj/ │ └── project.pbxproj ├── AFCacheTestTool-OSX/ │ ├── AFCacheTestTool/ │ │ ├── AFAppDelegate.h │ │ ├── AFAppDelegate.m │ │ ├── AFCacheTestTool-Info.plist │ │ ├── AFCacheTestTool-Prefix.pch │ │ ├── AFRequestInfo.h │ │ ├── AFRequestInfo.m │ │ ├── Base.lproj/ │ │ │ └── MainMenu.xib │ │ ├── Images.xcassets/ │ │ │ └── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ ├── en.lproj/ │ │ │ ├── Credits.rtf │ │ │ └── InfoPlist.strings │ │ └── main.m │ ├── AFCacheTestTool.xcodeproj/ │ │ └── project.pbxproj │ ├── AFCacheTestTool.xcworkspace/ │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata/ │ │ └── AFCacheTestTool.xccheckout │ ├── AFCacheTestToolTests/ │ │ ├── AFCacheTestToolTests-Info.plist │ │ ├── AFCacheTestToolTests.m │ │ └── en.lproj/ │ │ └── InfoPlist.strings │ └── Podfile ├── AFCacheTestTool-iOS/ │ ├── AFCacheTestTool/ │ │ ├── AFCacheTestTool/ │ │ │ ├── AFCacheTestTool-Info.plist │ │ │ ├── AFCacheTestTool-Prefix.pch │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── DetailViewController.h │ │ │ ├── DetailViewController.m │ │ │ ├── MasterViewController.h │ │ │ ├── MasterViewController.m │ │ │ ├── en.lproj/ │ │ │ │ ├── InfoPlist.strings │ │ │ │ └── MainStoryboard.storyboard │ │ │ └── main.m │ │ └── AFCacheTestTool.xcodeproj/ │ │ └── project.pbxproj │ ├── AFCacheTestTool-Info.plist │ ├── AFCacheTestTool-Prefix.pch │ ├── AFCacheTestToolAppDelegate.h │ ├── AFCacheTestToolAppDelegate.m │ ├── AFCacheableItemCell.h │ ├── AFCacheableItemCell.m │ ├── AFDebugHTTPURLProtocol.h │ ├── AFDebugHTTPURLProtocol.m │ ├── DetailViewController.h │ ├── DetailViewController.m │ ├── MasterViewController.h │ ├── MasterViewController.m │ ├── en.lproj/ │ │ ├── InfoPlist.strings │ │ └── MainStoryboard.storyboard │ └── main.m ├── AFCacheTestTool.xcodeproj/ │ └── project.pbxproj ├── AFCacheTests/ │ ├── AFCacheTests-Info.plist │ ├── AFCacheTests-Prefix.pch │ ├── AFCacheTests.h │ ├── AFCacheTests.m │ ├── en.lproj/ │ │ └── InfoPlist.strings │ └── iOS/ │ ├── AFCache-iOSTests-Info.plist │ ├── AFCache-iOSTests-Prefix.pch │ ├── AFCache_iOSTests.h │ ├── AFCache_iOSTests.m │ └── en.lproj/ │ └── InfoPlist.strings ├── CHANGES ├── LICENSE ├── README.markdown ├── configs/ │ ├── EngineRoom.xcconfig │ ├── base.xcconfig │ ├── debug/ │ │ ├── AFCache-OSX-debug.xcconfig │ │ ├── AFCache-iOS-debug.xcconfig │ │ ├── AFCacheDemoiOS-debug.xcconfig │ │ ├── AFCacheStatic-OSX-debug.xcconfig │ │ ├── afcpkg-debug.xcconfig │ │ ├── createFatLib-iOS.xcconfig │ │ └── testafcache-debug.xcconfig │ └── release/ │ ├── AFCache-OSX-release.xcconfig │ ├── AFCache-iOS-release.xcconfig │ ├── AFCacheDemoiOS-release.xcconfig │ ├── AFCacheStatic-OSX-release.xcconfig │ ├── afcpkg-release.xcconfig │ ├── createFatLib-release-iOS.xcconfig │ └── testafcache-release.xcconfig ├── material/ │ ├── AFCacheIcon.psd │ └── document-icon ├── resources/ │ └── OSX/ │ └── en.lproj/ │ └── InfoPlist.strings ├── scripts/ │ ├── AFCacheOSX-EngineRoom.sh │ ├── createFatLib.sh │ └── updateAPI.sh ├── src/ │ ├── 3rdparty/ │ │ └── AFRegexString/ │ │ ├── AFRegexString.h │ │ └── AFRegexString.m │ ├── Examples/ │ │ ├── CacheableItemDemoController.h │ │ ├── CacheableItemDemoController.m │ │ ├── CacheableItemDemoController.xib │ │ ├── Demo-Info.plist │ │ ├── DemoAppDelegate.h │ │ ├── DemoAppDelegate.m │ │ ├── Demo_Prefix.pch │ │ ├── MainWindow.xib │ │ ├── NSURLRequest.xib │ │ ├── NSURLRequestDemoViewController.h │ │ ├── NSURLRequestDemoViewController.m │ │ ├── Packaging.xib │ │ ├── PackagingDemoController.h │ │ ├── PackagingDemoController.m │ │ └── main.m │ ├── OSX/ │ │ ├── AFCache-Info.plist │ │ ├── AFCache-Prefix.pch │ │ ├── afcpkg_main.h │ │ └── afcpkg_main.m │ ├── iOS/ │ │ └── AFCache-iOS-Prefix.pch │ ├── python/ │ │ └── afcpkg.py │ └── shared/ │ ├── AFCache+DeprecatedAPI.h │ ├── AFCache+DeprecatedAPI.m │ ├── AFCache+FileAttributes.h │ ├── AFCache+FileAttributes.m │ ├── AFCache+Mimetypes.h │ ├── AFCache+Mimetypes.m │ ├── AFCache+Packaging.h │ ├── AFCache+Packaging.m │ ├── AFCache+PrivateAPI.h │ ├── AFCache.h │ ├── AFCache.m │ ├── AFCachePackageCreator.h │ ├── AFCachePackageCreator.m │ ├── AFCache_Logging.h │ ├── AFCacheableItem+FileAttributes.h │ ├── AFCacheableItem+FileAttributes.m │ ├── AFCacheableItem+Packaging.h │ ├── AFCacheableItem+Packaging.m │ ├── AFCacheableItem.h │ ├── AFCacheableItem.m │ ├── AFCacheableItemInfo.h │ ├── AFCacheableItemInfo.m │ ├── AFDownloadOperation.h │ ├── AFDownloadOperation.m │ ├── AFHTTPURLProtocol.h │ ├── AFHTTPURLProtocol.m │ ├── AFMediaTypeParser.h │ ├── AFMediaTypeParser.m │ ├── AFPackageInfo.h │ ├── AFPackageInfo.m │ ├── AFRequestConfiguration.h │ ├── AFRequestConfiguration.m │ ├── AFURLCache.h │ ├── AFURLCache.m │ ├── DateParser.h │ └── DateParser.m └── testserver.py ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .hg build *.mode1v3 *.pbxuser *.orig .DS_Store .metadata .project .settings *.perspectivev3 xcuserdata project.xcworkspace release/AFCacheLib.h # emacs noise *~ *# \#* .#* # vi noise .*.swp .idea Headers demo/Pods ================================================ FILE: AFCache-iOS.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXAggregateTarget section */ 379B6926177CAEA8001174E8 /* AFCache_universal */ = { isa = PBXAggregateTarget; buildConfigurationList = 379B692A177CAEA8001174E8 /* Build configuration list for PBXAggregateTarget "AFCache_universal" */; buildPhases = ( 379B692D177CAFF9001174E8 /* ShellScript */, 379B692E177CB01B001174E8 /* CopyFiles */, 0511702717D0EA72003EABBA /* CopyFiles */, ); dependencies = ( 379B692C177CAFCA001174E8 /* PBXTargetDependency */, ); name = AFCache_universal; productName = AFCache; }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ 0511702817D0EA85003EABBA /* libAFCache-iOS.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = 051B386D1328AACA0057F2F5 /* libAFCache-iOS.a */; }; 051B38711328AACA0057F2F5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051B38701328AACA0057F2F5 /* Foundation.framework */; }; 051B387C1328AACA0057F2F5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051B387B1328AACA0057F2F5 /* UIKit.framework */; }; 051B387D1328AACA0057F2F5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051B38701328AACA0057F2F5 /* Foundation.framework */; }; 051B387F1328AACA0057F2F5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051B387E1328AACA0057F2F5 /* CoreGraphics.framework */; }; 051B38821328AACA0057F2F5 /* libAFCache-iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 051B386D1328AACA0057F2F5 /* libAFCache-iOS.a */; }; 0544C870150F57980057EC39 /* AFMediaTypeParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 0544C86E150F57980057EC39 /* AFMediaTypeParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0544C871150F57980057EC39 /* AFMediaTypeParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 0544C86F150F57980057EC39 /* AFMediaTypeParser.m */; }; 0566AE021332D6B500583E6A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051B387B1328AACA0057F2F5 /* UIKit.framework */; }; 0566AE031332D6B500583E6A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051B38701328AACA0057F2F5 /* Foundation.framework */; }; 0566AE041332D6B500583E6A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051B387E1328AACA0057F2F5 /* CoreGraphics.framework */; }; 0566AE311332D6FD00583E6A /* DemoAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0566AE281332D6FD00583E6A /* DemoAppDelegate.m */; }; 0566AE321332D6FD00583E6A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0566AE291332D6FD00583E6A /* main.m */; }; 0566AE331332D6FD00583E6A /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0566AE2A1332D6FD00583E6A /* MainWindow.xib */; }; 0566AE341332D6FD00583E6A /* NSURLRequest.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0566AE2B1332D6FD00583E6A /* NSURLRequest.xib */; }; 0566AE351332D6FD00583E6A /* Packaging.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0566AE2C1332D6FD00583E6A /* Packaging.xib */; }; 0566AE361332D6FD00583E6A /* PackagingDemoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0566AE2E1332D6FD00583E6A /* PackagingDemoController.m */; }; 0566AE391332D7A900583E6A /* libAFCache-iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 051B386D1328AACA0057F2F5 /* libAFCache-iOS.a */; }; 0566AE3B1332D7E300583E6A /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0566AE3A1332D7E300583E6A /* SystemConfiguration.framework */; }; 0566AE411332D85600583E6A /* CacheableItemDemoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0566AE3D1332D85600583E6A /* CacheableItemDemoController.m */; }; 0566AE421332D85600583E6A /* CacheableItemDemoController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0566AE3E1332D85600583E6A /* CacheableItemDemoController.xib */; }; 0566AE431332D85600583E6A /* NSURLRequestDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0566AE401332D85600583E6A /* NSURLRequestDemoViewController.m */; }; 0566AE541332D98200583E6A /* Icon57x57.png in Resources */ = {isa = PBXBuildFile; fileRef = 0566AE511332D98200583E6A /* Icon57x57.png */; }; 0566AE551332D98200583E6A /* Icon72x72.png in Resources */ = {isa = PBXBuildFile; fileRef = 0566AE521332D98200583E6A /* Icon72x72.png */; }; 0566AE561332D98200583E6A /* Icon114x114.png in Resources */ = {isa = PBXBuildFile; fileRef = 0566AE531332D98200583E6A /* Icon114x114.png */; }; 0566AE581332DA2500583E6A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0566AE571332DA2500583E6A /* libz.dylib */; }; 0569DE611328AD5B00B3D016 /* AFCache_iOSTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE5C1328AD5B00B3D016 /* AFCache_iOSTests.m */; }; 0569DE621328AD5B00B3D016 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0569DE5D1328AD5B00B3D016 /* InfoPlist.strings */; }; 0569DE941328AD9C00B3D016 /* AFRegexString.h in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE671328AD9C00B3D016 /* AFRegexString.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DE951328AD9C00B3D016 /* AFRegexString.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE681328AD9C00B3D016 /* AFRegexString.m */; }; 0569DE961328AD9C00B3D016 /* AFRegexString.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE681328AD9C00B3D016 /* AFRegexString.m */; }; 0569DEAA1328AD9C00B3D016 /* AFCache-iOS-Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE781328AD9C00B3D016 /* AFCache-iOS-Prefix.pch */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DEAF1328AD9C00B3D016 /* AFCache+Mimetypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE7F1328AD9C00B3D016 /* AFCache+Mimetypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DEB01328AD9C00B3D016 /* AFCache+Mimetypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE801328AD9C00B3D016 /* AFCache+Mimetypes.m */; }; 0569DEB11328AD9C00B3D016 /* AFCache+Mimetypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE801328AD9C00B3D016 /* AFCache+Mimetypes.m */; }; 0569DEB51328AD9C00B3D016 /* AFCache+PrivateAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE831328AD9C00B3D016 /* AFCache+PrivateAPI.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DEB61328AD9C00B3D016 /* AFCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE841328AD9C00B3D016 /* AFCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DEB71328AD9C00B3D016 /* AFCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE851328AD9C00B3D016 /* AFCache.m */; }; 0569DEB81328AD9C00B3D016 /* AFCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE851328AD9C00B3D016 /* AFCache.m */; }; 0569DEB91328AD9C00B3D016 /* AFCache_Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE861328AD9C00B3D016 /* AFCache_Logging.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DEBD1328AD9C00B3D016 /* AFCacheableItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE891328AD9C00B3D016 /* AFCacheableItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DEBE1328AD9C00B3D016 /* AFCacheableItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE8A1328AD9C00B3D016 /* AFCacheableItem.m */; }; 0569DEBF1328AD9C00B3D016 /* AFCacheableItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE8A1328AD9C00B3D016 /* AFCacheableItem.m */; }; 0569DEC01328AD9C00B3D016 /* AFCacheableItemInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE8B1328AD9C00B3D016 /* AFCacheableItemInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DEC11328AD9C00B3D016 /* AFCacheableItemInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE8C1328AD9C00B3D016 /* AFCacheableItemInfo.m */; }; 0569DEC21328AD9C00B3D016 /* AFCacheableItemInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE8C1328AD9C00B3D016 /* AFCacheableItemInfo.m */; }; 0569DEC31328AD9C00B3D016 /* AFPackageInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE8D1328AD9C00B3D016 /* AFPackageInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DEC41328AD9C00B3D016 /* AFPackageInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE8E1328AD9C00B3D016 /* AFPackageInfo.m */; }; 0569DEC51328AD9C00B3D016 /* AFPackageInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE8E1328AD9C00B3D016 /* AFPackageInfo.m */; }; 0569DEC61328AD9C00B3D016 /* AFURLCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE8F1328AD9C00B3D016 /* AFURLCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DEC71328AD9C00B3D016 /* AFURLCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE901328AD9C00B3D016 /* AFURLCache.m */; }; 0569DEC81328AD9C00B3D016 /* AFURLCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE901328AD9C00B3D016 /* AFURLCache.m */; }; 0569DECA1328AD9C00B3D016 /* DateParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 0569DE921328AD9C00B3D016 /* DateParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0569DECB1328AD9C00B3D016 /* DateParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE931328AD9C00B3D016 /* DateParser.m */; }; 0569DECC1328AD9C00B3D016 /* DateParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 0569DE931328AD9C00B3D016 /* DateParser.m */; }; 058339CD150CB747005A6D55 /* AFHTTPURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 058339CB150CB747005A6D55 /* AFHTTPURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 058339CE150CB747005A6D55 /* AFHTTPURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 058339CC150CB747005A6D55 /* AFHTTPURLProtocol.m */; }; 05F1D1CA182F9D0400C2D295 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0566AE3A1332D7E300583E6A /* SystemConfiguration.framework */; }; 05F1D1CB182F9D0B00C2D295 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0566AE571332DA2500583E6A /* libz.dylib */; }; 379B6936177CBC38001174E8 /* AFMediaTypeParser.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0544C86E150F57980057EC39 /* AFMediaTypeParser.h */; }; 379B6937177CBC38001174E8 /* AFCache+Mimetypes.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0569DE7F1328AD9C00B3D016 /* AFCache+Mimetypes.h */; }; 379B6939177CBC38001174E8 /* AFCache+PrivateAPI.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0569DE831328AD9C00B3D016 /* AFCache+PrivateAPI.h */; }; 379B693A177CBC38001174E8 /* AFCache.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0569DE841328AD9C00B3D016 /* AFCache.h */; }; 379B693B177CBC38001174E8 /* AFCache_Logging.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0569DE861328AD9C00B3D016 /* AFCache_Logging.h */; }; 379B693D177CBC38001174E8 /* AFCacheableItem.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0569DE891328AD9C00B3D016 /* AFCacheableItem.h */; }; 379B693E177CBC38001174E8 /* AFCacheableItemInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0569DE8B1328AD9C00B3D016 /* AFCacheableItemInfo.h */; }; 379B693F177CBC38001174E8 /* AFPackageInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0569DE8D1328AD9C00B3D016 /* AFPackageInfo.h */; }; 379B6940177CBC38001174E8 /* AFURLCache.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0569DE8F1328AD9C00B3D016 /* AFURLCache.h */; }; 379B6941177CBC38001174E8 /* Constants.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0569DE911328AD9C00B3D016 /* Constants.h */; }; 379B6942177CBC38001174E8 /* DateParser.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0569DE921328AD9C00B3D016 /* DateParser.h */; }; 379B6943177CBC38001174E8 /* AFHTTPURLProtocol.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 058339CB150CB747005A6D55 /* AFHTTPURLProtocol.h */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 051B38801328AACA0057F2F5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 051B38641328AACA0057F2F5 /* Project object */; proxyType = 1; remoteGlobalIDString = 051B386C1328AACA0057F2F5; remoteInfo = "AFCache-iOS"; }; 0566AE371332D79C00583E6A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 051B38641328AACA0057F2F5 /* Project object */; proxyType = 1; remoteGlobalIDString = 051B386C1328AACA0057F2F5; remoteInfo = "AFCache-iOS"; }; 379B692B177CAFCA001174E8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 051B38641328AACA0057F2F5 /* Project object */; proxyType = 1; remoteGlobalIDString = 051B386C1328AACA0057F2F5; remoteInfo = "AFCache-iOS"; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 0511702717D0EA72003EABBA /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = "~/build_libs"; dstSubfolderSpec = 0; files = ( 0511702817D0EA85003EABBA /* libAFCache-iOS.a in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; 379B692E177CB01B001174E8 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = "${SRCROOT}/$DEPLOYMENT_TARGET/$LIB_BASE_NAME"; dstSubfolderSpec = 0; files = ( 379B6936177CBC38001174E8 /* AFMediaTypeParser.h in CopyFiles */, 379B6937177CBC38001174E8 /* AFCache+Mimetypes.h in CopyFiles */, 379B6939177CBC38001174E8 /* AFCache+PrivateAPI.h in CopyFiles */, 379B693A177CBC38001174E8 /* AFCache.h in CopyFiles */, 379B693B177CBC38001174E8 /* AFCache_Logging.h in CopyFiles */, 379B693D177CBC38001174E8 /* AFCacheableItem.h in CopyFiles */, 379B693E177CBC38001174E8 /* AFCacheableItemInfo.h in CopyFiles */, 379B693F177CBC38001174E8 /* AFPackageInfo.h in CopyFiles */, 379B6940177CBC38001174E8 /* AFURLCache.h in CopyFiles */, 379B6941177CBC38001174E8 /* Constants.h in CopyFiles */, 379B6942177CBC38001174E8 /* DateParser.h in CopyFiles */, 379B6943177CBC38001174E8 /* AFHTTPURLProtocol.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 051B386D1328AACA0057F2F5 /* libAFCache-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libAFCache-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 051B38701328AACA0057F2F5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 051B387A1328AACA0057F2F5 /* AFCache-iOSTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AFCache-iOSTests.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; 051B387B1328AACA0057F2F5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 051B387E1328AACA0057F2F5 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 0544C86E150F57980057EC39 /* AFMediaTypeParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFMediaTypeParser.h; sourceTree = ""; }; 0544C86F150F57980057EC39 /* AFMediaTypeParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFMediaTypeParser.m; sourceTree = ""; }; 0566AE001332D6B500583E6A /* AFCacheDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AFCacheDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 0566AE251332D6FD00583E6A /* Demo_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Demo_Prefix.pch; path = src/Examples/Demo_Prefix.pch; sourceTree = SOURCE_ROOT; }; 0566AE261332D6FD00583E6A /* Demo-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Demo-Info.plist"; path = "src/Examples/Demo-Info.plist"; sourceTree = SOURCE_ROOT; }; 0566AE271332D6FD00583E6A /* DemoAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DemoAppDelegate.h; path = src/Examples/DemoAppDelegate.h; sourceTree = SOURCE_ROOT; }; 0566AE281332D6FD00583E6A /* DemoAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DemoAppDelegate.m; path = src/Examples/DemoAppDelegate.m; sourceTree = SOURCE_ROOT; }; 0566AE291332D6FD00583E6A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/Examples/main.m; sourceTree = SOURCE_ROOT; }; 0566AE2A1332D6FD00583E6A /* MainWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MainWindow.xib; path = src/Examples/MainWindow.xib; sourceTree = SOURCE_ROOT; }; 0566AE2B1332D6FD00583E6A /* NSURLRequest.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = NSURLRequest.xib; path = src/Examples/NSURLRequest.xib; sourceTree = SOURCE_ROOT; }; 0566AE2C1332D6FD00583E6A /* Packaging.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = Packaging.xib; path = src/Examples/Packaging.xib; sourceTree = SOURCE_ROOT; }; 0566AE2D1332D6FD00583E6A /* PackagingDemoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PackagingDemoController.h; path = src/Examples/PackagingDemoController.h; sourceTree = SOURCE_ROOT; }; 0566AE2E1332D6FD00583E6A /* PackagingDemoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PackagingDemoController.m; path = src/Examples/PackagingDemoController.m; sourceTree = SOURCE_ROOT; }; 0566AE3A1332D7E300583E6A /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 0566AE3C1332D85600583E6A /* CacheableItemDemoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CacheableItemDemoController.h; path = src/Examples/CacheableItemDemoController.h; sourceTree = SOURCE_ROOT; }; 0566AE3D1332D85600583E6A /* CacheableItemDemoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CacheableItemDemoController.m; path = src/Examples/CacheableItemDemoController.m; sourceTree = SOURCE_ROOT; }; 0566AE3E1332D85600583E6A /* CacheableItemDemoController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = CacheableItemDemoController.xib; path = src/Examples/CacheableItemDemoController.xib; sourceTree = SOURCE_ROOT; }; 0566AE3F1332D85600583E6A /* NSURLRequestDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSURLRequestDemoViewController.h; path = src/Examples/NSURLRequestDemoViewController.h; sourceTree = SOURCE_ROOT; }; 0566AE401332D85600583E6A /* NSURLRequestDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSURLRequestDemoViewController.m; path = src/Examples/NSURLRequestDemoViewController.m; sourceTree = SOURCE_ROOT; }; 0566AE511332D98200583E6A /* Icon57x57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon57x57.png; sourceTree = SOURCE_ROOT; }; 0566AE521332D98200583E6A /* Icon72x72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon72x72.png; sourceTree = SOURCE_ROOT; }; 0566AE531332D98200583E6A /* Icon114x114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon114x114.png; sourceTree = SOURCE_ROOT; }; 0566AE571332DA2500583E6A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 0569DE591328AD5B00B3D016 /* AFCache-iOSTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "AFCache-iOSTests-Info.plist"; sourceTree = ""; }; 0569DE5A1328AD5B00B3D016 /* AFCache-iOSTests-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AFCache-iOSTests-Prefix.pch"; sourceTree = ""; }; 0569DE5B1328AD5B00B3D016 /* AFCache_iOSTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFCache_iOSTests.h; sourceTree = ""; }; 0569DE5C1328AD5B00B3D016 /* AFCache_iOSTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFCache_iOSTests.m; sourceTree = ""; }; 0569DE5E1328AD5B00B3D016 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 0569DE671328AD9C00B3D016 /* AFRegexString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFRegexString.h; sourceTree = ""; }; 0569DE681328AD9C00B3D016 /* AFRegexString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFRegexString.m; sourceTree = ""; }; 0569DE781328AD9C00B3D016 /* AFCache-iOS-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AFCache-iOS-Prefix.pch"; sourceTree = ""; }; 0569DE7F1328AD9C00B3D016 /* AFCache+Mimetypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AFCache+Mimetypes.h"; sourceTree = ""; }; 0569DE801328AD9C00B3D016 /* AFCache+Mimetypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AFCache+Mimetypes.m"; sourceTree = ""; }; 0569DE831328AD9C00B3D016 /* AFCache+PrivateAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AFCache+PrivateAPI.h"; sourceTree = ""; }; 0569DE841328AD9C00B3D016 /* AFCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFCache.h; sourceTree = ""; }; 0569DE851328AD9C00B3D016 /* AFCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFCache.m; sourceTree = ""; }; 0569DE861328AD9C00B3D016 /* AFCache_Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFCache_Logging.h; sourceTree = ""; }; 0569DE891328AD9C00B3D016 /* AFCacheableItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFCacheableItem.h; sourceTree = ""; }; 0569DE8A1328AD9C00B3D016 /* AFCacheableItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFCacheableItem.m; sourceTree = ""; }; 0569DE8B1328AD9C00B3D016 /* AFCacheableItemInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFCacheableItemInfo.h; sourceTree = ""; }; 0569DE8C1328AD9C00B3D016 /* AFCacheableItemInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFCacheableItemInfo.m; sourceTree = ""; }; 0569DE8D1328AD9C00B3D016 /* AFPackageInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFPackageInfo.h; sourceTree = ""; }; 0569DE8E1328AD9C00B3D016 /* AFPackageInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFPackageInfo.m; sourceTree = ""; }; 0569DE8F1328AD9C00B3D016 /* AFURLCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLCache.h; sourceTree = ""; }; 0569DE901328AD9C00B3D016 /* AFURLCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLCache.m; sourceTree = ""; }; 0569DE911328AD9C00B3D016 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; 0569DE921328AD9C00B3D016 /* DateParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateParser.h; sourceTree = ""; }; 0569DE931328AD9C00B3D016 /* DateParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DateParser.m; sourceTree = ""; }; 058339CB150CB747005A6D55 /* AFHTTPURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPURLProtocol.h; sourceTree = ""; }; 058339CC150CB747005A6D55 /* AFHTTPURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPURLProtocol.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 051B386A1328AACA0057F2F5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 051B38711328AACA0057F2F5 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 051B38761328AACA0057F2F5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 05F1D1CB182F9D0B00C2D295 /* libz.dylib in Frameworks */, 05F1D1CA182F9D0400C2D295 /* SystemConfiguration.framework in Frameworks */, 051B387C1328AACA0057F2F5 /* UIKit.framework in Frameworks */, 051B387D1328AACA0057F2F5 /* Foundation.framework in Frameworks */, 051B387F1328AACA0057F2F5 /* CoreGraphics.framework in Frameworks */, 051B38821328AACA0057F2F5 /* libAFCache-iOS.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 0566ADFD1332D6B500583E6A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 0566AE581332DA2500583E6A /* libz.dylib in Frameworks */, 0566AE3B1332D7E300583E6A /* SystemConfiguration.framework in Frameworks */, 0566AE391332D7A900583E6A /* libAFCache-iOS.a in Frameworks */, 0566AE021332D6B500583E6A /* UIKit.framework in Frameworks */, 0566AE031332D6B500583E6A /* Foundation.framework in Frameworks */, 0566AE041332D6B500583E6A /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 051B38621328AACA0057F2F5 = { isa = PBXGroup; children = ( 0566AE571332DA2500583E6A /* libz.dylib */, 0566AE3A1332D7E300583E6A /* SystemConfiguration.framework */, 051B386D1328AACA0057F2F5 /* libAFCache-iOS.a */, 0569DE641328AD9C00B3D016 /* src */, 0569DE571328AD5B00B3D016 /* test */, 0566AE051332D6B500583E6A /* AFCacheDemo */, 051B386F1328AACA0057F2F5 /* Frameworks */, 051B386E1328AACA0057F2F5 /* Products */, ); sourceTree = ""; }; 051B386E1328AACA0057F2F5 /* Products */ = { isa = PBXGroup; children = ( 051B387A1328AACA0057F2F5 /* AFCache-iOSTests.octest */, 0566AE001332D6B500583E6A /* AFCacheDemo.app */, ); name = Products; sourceTree = ""; }; 051B386F1328AACA0057F2F5 /* Frameworks */ = { isa = PBXGroup; children = ( 051B38701328AACA0057F2F5 /* Foundation.framework */, 051B387B1328AACA0057F2F5 /* UIKit.framework */, 051B387E1328AACA0057F2F5 /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; 0566AE051332D6B500583E6A /* AFCacheDemo */ = { isa = PBXGroup; children = ( 0566AE451332D89000583E6A /* Resources */, 0566AE441332D88D00583E6A /* src */, ); path = AFCacheDemo; sourceTree = ""; }; 0566AE441332D88D00583E6A /* src */ = { isa = PBXGroup; children = ( 0566AE3C1332D85600583E6A /* CacheableItemDemoController.h */, 0566AE3D1332D85600583E6A /* CacheableItemDemoController.m */, 0566AE3E1332D85600583E6A /* CacheableItemDemoController.xib */, 0566AE3F1332D85600583E6A /* NSURLRequestDemoViewController.h */, 0566AE401332D85600583E6A /* NSURLRequestDemoViewController.m */, 0566AE251332D6FD00583E6A /* Demo_Prefix.pch */, 0566AE261332D6FD00583E6A /* Demo-Info.plist */, 0566AE271332D6FD00583E6A /* DemoAppDelegate.h */, 0566AE281332D6FD00583E6A /* DemoAppDelegate.m */, 0566AE291332D6FD00583E6A /* main.m */, 0566AE2D1332D6FD00583E6A /* PackagingDemoController.h */, 0566AE2E1332D6FD00583E6A /* PackagingDemoController.m */, ); name = src; sourceTree = ""; }; 0566AE451332D89000583E6A /* Resources */ = { isa = PBXGroup; children = ( 0566AE461332D8AC00583E6A /* img */, 0566AE2A1332D6FD00583E6A /* MainWindow.xib */, 0566AE2B1332D6FD00583E6A /* NSURLRequest.xib */, 0566AE2C1332D6FD00583E6A /* Packaging.xib */, ); name = Resources; sourceTree = ""; }; 0566AE461332D8AC00583E6A /* img */ = { isa = PBXGroup; children = ( 0566AE511332D98200583E6A /* Icon57x57.png */, 0566AE521332D98200583E6A /* Icon72x72.png */, 0566AE531332D98200583E6A /* Icon114x114.png */, ); name = img; sourceTree = ""; }; 0569DE571328AD5B00B3D016 /* test */ = { isa = PBXGroup; children = ( 0569DE581328AD5B00B3D016 /* iOS */, ); path = test; sourceTree = ""; }; 0569DE581328AD5B00B3D016 /* iOS */ = { isa = PBXGroup; children = ( 0569DE591328AD5B00B3D016 /* AFCache-iOSTests-Info.plist */, 0569DE5A1328AD5B00B3D016 /* AFCache-iOSTests-Prefix.pch */, 0569DE5B1328AD5B00B3D016 /* AFCache_iOSTests.h */, 0569DE5C1328AD5B00B3D016 /* AFCache_iOSTests.m */, 0569DE5D1328AD5B00B3D016 /* InfoPlist.strings */, ); path = iOS; sourceTree = ""; }; 0569DE641328AD9C00B3D016 /* src */ = { isa = PBXGroup; children = ( 0569DE651328AD9C00B3D016 /* 3rdparty */, 0569DE771328AD9C00B3D016 /* iOS */, 0569DE7E1328AD9C00B3D016 /* shared */, ); path = src; sourceTree = ""; }; 0569DE651328AD9C00B3D016 /* 3rdparty */ = { isa = PBXGroup; children = ( 0569DE661328AD9C00B3D016 /* AFRegexString */, ); path = 3rdparty; sourceTree = ""; }; 0569DE661328AD9C00B3D016 /* AFRegexString */ = { isa = PBXGroup; children = ( 0569DE671328AD9C00B3D016 /* AFRegexString.h */, 0569DE681328AD9C00B3D016 /* AFRegexString.m */, ); path = AFRegexString; sourceTree = ""; }; 0569DE771328AD9C00B3D016 /* iOS */ = { isa = PBXGroup; children = ( 0569DE781328AD9C00B3D016 /* AFCache-iOS-Prefix.pch */, ); path = iOS; sourceTree = ""; }; 0569DE7E1328AD9C00B3D016 /* shared */ = { isa = PBXGroup; children = ( 0544C86E150F57980057EC39 /* AFMediaTypeParser.h */, 0544C86F150F57980057EC39 /* AFMediaTypeParser.m */, 0569DE7F1328AD9C00B3D016 /* AFCache+Mimetypes.h */, 0569DE801328AD9C00B3D016 /* AFCache+Mimetypes.m */, 0569DE831328AD9C00B3D016 /* AFCache+PrivateAPI.h */, 0569DE841328AD9C00B3D016 /* AFCache.h */, 0569DE851328AD9C00B3D016 /* AFCache.m */, 0569DE861328AD9C00B3D016 /* AFCache_Logging.h */, 0569DE891328AD9C00B3D016 /* AFCacheableItem.h */, 0569DE8A1328AD9C00B3D016 /* AFCacheableItem.m */, 0569DE8B1328AD9C00B3D016 /* AFCacheableItemInfo.h */, 0569DE8C1328AD9C00B3D016 /* AFCacheableItemInfo.m */, 0569DE8D1328AD9C00B3D016 /* AFPackageInfo.h */, 0569DE8E1328AD9C00B3D016 /* AFPackageInfo.m */, 0569DE8F1328AD9C00B3D016 /* AFURLCache.h */, 0569DE901328AD9C00B3D016 /* AFURLCache.m */, 0569DE911328AD9C00B3D016 /* Constants.h */, 0569DE921328AD9C00B3D016 /* DateParser.h */, 0569DE931328AD9C00B3D016 /* DateParser.m */, 058339CB150CB747005A6D55 /* AFHTTPURLProtocol.h */, 058339CC150CB747005A6D55 /* AFHTTPURLProtocol.m */, ); path = shared; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 051B386B1328AACA0057F2F5 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 0569DE941328AD9C00B3D016 /* AFRegexString.h in Headers */, 0569DEAA1328AD9C00B3D016 /* AFCache-iOS-Prefix.pch in Headers */, 0569DEAF1328AD9C00B3D016 /* AFCache+Mimetypes.h in Headers */, 0569DEB51328AD9C00B3D016 /* AFCache+PrivateAPI.h in Headers */, 0569DEB61328AD9C00B3D016 /* AFCache.h in Headers */, 0569DEB91328AD9C00B3D016 /* AFCache_Logging.h in Headers */, 0569DEBD1328AD9C00B3D016 /* AFCacheableItem.h in Headers */, 0569DEC01328AD9C00B3D016 /* AFCacheableItemInfo.h in Headers */, 0569DEC31328AD9C00B3D016 /* AFPackageInfo.h in Headers */, 0569DEC61328AD9C00B3D016 /* AFURLCache.h in Headers */, 0569DECA1328AD9C00B3D016 /* DateParser.h in Headers */, 058339CD150CB747005A6D55 /* AFHTTPURLProtocol.h in Headers */, 0544C870150F57980057EC39 /* AFMediaTypeParser.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 051B386C1328AACA0057F2F5 /* AFCache-iOS */ = { isa = PBXNativeTarget; buildConfigurationList = 051B38901328AACA0057F2F5 /* Build configuration list for PBXNativeTarget "AFCache-iOS" */; buildPhases = ( 051B38691328AACA0057F2F5 /* Sources */, 051B386A1328AACA0057F2F5 /* Frameworks */, 051B386B1328AACA0057F2F5 /* Headers */, ); buildRules = ( ); dependencies = ( ); name = "AFCache-iOS"; productName = "AFCache-iOS"; productReference = 051B386D1328AACA0057F2F5 /* libAFCache-iOS.a */; productType = "com.apple.product-type.library.static"; }; 051B38791328AACA0057F2F5 /* AFCache-iOSTests */ = { isa = PBXNativeTarget; buildConfigurationList = 051B38931328AACA0057F2F5 /* Build configuration list for PBXNativeTarget "AFCache-iOSTests" */; buildPhases = ( 051B38751328AACA0057F2F5 /* Sources */, 051B38761328AACA0057F2F5 /* Frameworks */, 051B38771328AACA0057F2F5 /* Resources */, 051B38781328AACA0057F2F5 /* ShellScript */, ); buildRules = ( ); dependencies = ( 051B38811328AACA0057F2F5 /* PBXTargetDependency */, ); name = "AFCache-iOSTests"; productName = "AFCache-iOSTests"; productReference = 051B387A1328AACA0057F2F5 /* AFCache-iOSTests.octest */; productType = "com.apple.product-type.bundle"; }; 0566ADFF1332D6B500583E6A /* AFCacheDemo */ = { isa = PBXNativeTarget; buildConfigurationList = 0566AE221332D6B500583E6A /* Build configuration list for PBXNativeTarget "AFCacheDemo" */; buildPhases = ( 0566ADFC1332D6B500583E6A /* Sources */, 0566ADFD1332D6B500583E6A /* Frameworks */, 0566ADFE1332D6B500583E6A /* Resources */, ); buildRules = ( ); dependencies = ( 0566AE381332D79C00583E6A /* PBXTargetDependency */, ); name = AFCacheDemo; productName = AFCacheDemo; productReference = 0566AE001332D6B500583E6A /* AFCacheDemo.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 051B38641328AACA0057F2F5 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0510; ORGANIZATIONNAME = "Artifacts - Fine Software Development"; }; buildConfigurationList = 051B38671328AACA0057F2F5 /* Build configuration list for PBXProject "AFCache-iOS" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 051B38621328AACA0057F2F5; productRefGroup = 051B386E1328AACA0057F2F5 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 051B386C1328AACA0057F2F5 /* AFCache-iOS */, 051B38791328AACA0057F2F5 /* AFCache-iOSTests */, 0566ADFF1332D6B500583E6A /* AFCacheDemo */, 379B6926177CAEA8001174E8 /* AFCache_universal */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 051B38771328AACA0057F2F5 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 0569DE621328AD5B00B3D016 /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 0566ADFE1332D6B500583E6A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 0566AE331332D6FD00583E6A /* MainWindow.xib in Resources */, 0566AE341332D6FD00583E6A /* NSURLRequest.xib in Resources */, 0566AE351332D6FD00583E6A /* Packaging.xib in Resources */, 0566AE421332D85600583E6A /* CacheableItemDemoController.xib in Resources */, 0566AE541332D98200583E6A /* Icon57x57.png in Resources */, 0566AE551332D98200583E6A /* Icon72x72.png in Resources */, 0566AE561332D98200583E6A /* Icon114x114.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 051B38781328AACA0057F2F5 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; }; 379B692D177CAFF9001174E8 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "sh scripts/createFatLib.sh"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 051B38691328AACA0057F2F5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 0569DE951328AD9C00B3D016 /* AFRegexString.m in Sources */, 0569DEB01328AD9C00B3D016 /* AFCache+Mimetypes.m in Sources */, 0569DEB71328AD9C00B3D016 /* AFCache.m in Sources */, 0569DEBE1328AD9C00B3D016 /* AFCacheableItem.m in Sources */, 0569DEC11328AD9C00B3D016 /* AFCacheableItemInfo.m in Sources */, 0569DEC41328AD9C00B3D016 /* AFPackageInfo.m in Sources */, 0569DEC71328AD9C00B3D016 /* AFURLCache.m in Sources */, 0569DECB1328AD9C00B3D016 /* DateParser.m in Sources */, 058339CE150CB747005A6D55 /* AFHTTPURLProtocol.m in Sources */, 0544C871150F57980057EC39 /* AFMediaTypeParser.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 051B38751328AACA0057F2F5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 0569DE611328AD5B00B3D016 /* AFCache_iOSTests.m in Sources */, 0569DE961328AD9C00B3D016 /* AFRegexString.m in Sources */, 0569DEB11328AD9C00B3D016 /* AFCache+Mimetypes.m in Sources */, 0569DEB81328AD9C00B3D016 /* AFCache.m in Sources */, 0569DEBF1328AD9C00B3D016 /* AFCacheableItem.m in Sources */, 0569DEC21328AD9C00B3D016 /* AFCacheableItemInfo.m in Sources */, 0569DEC51328AD9C00B3D016 /* AFPackageInfo.m in Sources */, 0569DEC81328AD9C00B3D016 /* AFURLCache.m in Sources */, 0569DECC1328AD9C00B3D016 /* DateParser.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 0566ADFC1332D6B500583E6A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 0566AE311332D6FD00583E6A /* DemoAppDelegate.m in Sources */, 0566AE321332D6FD00583E6A /* main.m in Sources */, 0566AE361332D6FD00583E6A /* PackagingDemoController.m in Sources */, 0566AE411332D85600583E6A /* CacheableItemDemoController.m in Sources */, 0566AE431332D85600583E6A /* NSURLRequestDemoViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 051B38811328AACA0057F2F5 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 051B386C1328AACA0057F2F5 /* AFCache-iOS */; targetProxy = 051B38801328AACA0057F2F5 /* PBXContainerItemProxy */; }; 0566AE381332D79C00583E6A /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 051B386C1328AACA0057F2F5 /* AFCache-iOS */; targetProxy = 0566AE371332D79C00583E6A /* PBXContainerItemProxy */; }; 379B692C177CAFCA001174E8 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 051B386C1328AACA0057F2F5 /* AFCache-iOS */; targetProxy = 379B692B177CAFCA001174E8 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 0569DE5D1328AD5B00B3D016 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 0569DE5E1328AD5B00B3D016 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 04A29CFD147C080700B264EF /* Adhoc */ = { isa = XCBuildConfiguration; buildSettings = { GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvmgcc42; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; SDKROOT = iphoneos; }; name = Adhoc; }; 04A29CFE147C080700B264EF /* Adhoc */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; DSTROOT = /tmp/AFCache_iOS.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/iOS/AFCache-iOS-Prefix.pch"; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; PUBLIC_HEADERS_FOLDER_PATH = ../../Headers/AFCache; SKIP_INSTALL = YES; }; name = Adhoc; }; 04A29CFF147C080700B264EF /* Adhoc */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(DEVELOPER_LIBRARY_DIR)/Frameworks", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "test/iOS/AFCache-iOSTests-Prefix.pch"; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "test/iOS/AFCache-iOSTests-Info.plist"; OTHER_LDFLAGS = ( "-framework", SenTestingKit, ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = octest; }; name = Adhoc; }; 04A29D00147C080700B264EF /* Adhoc */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = src/Examples/Demo_Prefix.pch; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "src/Examples/Demo-Info.plist"; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = ( "-ObjC", "-all_load", ); PRODUCT_NAME = "$(TARGET_NAME)"; VALIDATE_PRODUCT = YES; WRAPPER_EXTENSION = app; }; name = Adhoc; }; 051B388E1328AACA0057F2F5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { DEPLOYMENT_TARGET = ../sharedLib/; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvmgcc42; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; LIB_BASE_NAME = ERBeans; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; }; 051B388F1328AACA0057F2F5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { DEPLOYMENT_TARGET = ../sharedLib/; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvmgcc42; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; LIB_BASE_NAME = ERBeans; SDKROOT = iphoneos; }; name = Release; }; 051B38911328AACA0057F2F5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; DSTROOT = /tmp/AFCache_iOS.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/iOS/AFCache-iOS-Prefix.pch"; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; PUBLIC_HEADERS_FOLDER_PATH = ../../Headers/AFCache; SKIP_INSTALL = YES; }; name = Debug; }; 051B38921328AACA0057F2F5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; DSTROOT = /tmp/AFCache_iOS.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/iOS/AFCache-iOS-Prefix.pch"; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; PUBLIC_HEADERS_FOLDER_PATH = ../../Headers/AFCache; SKIP_INSTALL = YES; }; name = Release; }; 051B38941328AACA0057F2F5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(DEVELOPER_LIBRARY_DIR)/Frameworks", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "test/iOS/AFCache-iOSTests-Prefix.pch"; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "test/iOS/AFCache-iOSTests-Info.plist"; OTHER_LDFLAGS = ( "-framework", SenTestingKit, ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = octest; }; name = Debug; }; 051B38951328AACA0057F2F5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(DEVELOPER_LIBRARY_DIR)/Frameworks", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "test/iOS/AFCache-iOSTests-Prefix.pch"; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "test/iOS/AFCache-iOSTests-Info.plist"; OTHER_LDFLAGS = ( "-framework", SenTestingKit, ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = octest; }; name = Release; }; 0566AE201332D6B500583E6A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = src/Examples/Demo_Prefix.pch; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "src/Examples/Demo-Info.plist"; OTHER_LDFLAGS = ( "-ObjC", "-all_load", ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; 0566AE211332D6B500583E6A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = src/Examples/Demo_Prefix.pch; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "src/Examples/Demo-Info.plist"; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = ( "-ObjC", "-all_load", ); PRODUCT_NAME = "$(TARGET_NAME)"; VALIDATE_PRODUCT = YES; WRAPPER_EXTENSION = app; }; name = Release; }; 379B6927177CAEA8001174E8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { DEPLOYMENT_TARGET = ../sharedLib; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; LIB_BASE_NAME = AFCache; PRODUCT_NAME = "AFCache-iOS"; }; name = Debug; }; 379B6928177CAEA8001174E8 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { DEPLOYMENT_TARGET = ../sharedLib; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; LIB_BASE_NAME = AFCache; PRODUCT_NAME = "AFCache-iOS"; }; name = Release; }; 379B6929177CAEA8001174E8 /* Adhoc */ = { isa = XCBuildConfiguration; buildSettings = { DEPLOYMENT_TARGET = ../sharedLib; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; LIB_BASE_NAME = AFCache; PRODUCT_NAME = "AFCache-iOS"; }; name = Adhoc; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 051B38671328AACA0057F2F5 /* Build configuration list for PBXProject "AFCache-iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( 051B388E1328AACA0057F2F5 /* Debug */, 051B388F1328AACA0057F2F5 /* Release */, 04A29CFD147C080700B264EF /* Adhoc */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 051B38901328AACA0057F2F5 /* Build configuration list for PBXNativeTarget "AFCache-iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( 051B38911328AACA0057F2F5 /* Debug */, 051B38921328AACA0057F2F5 /* Release */, 04A29CFE147C080700B264EF /* Adhoc */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 051B38931328AACA0057F2F5 /* Build configuration list for PBXNativeTarget "AFCache-iOSTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 051B38941328AACA0057F2F5 /* Debug */, 051B38951328AACA0057F2F5 /* Release */, 04A29CFF147C080700B264EF /* Adhoc */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 0566AE221332D6B500583E6A /* Build configuration list for PBXNativeTarget "AFCacheDemo" */ = { isa = XCConfigurationList; buildConfigurations = ( 0566AE201332D6B500583E6A /* Debug */, 0566AE211332D6B500583E6A /* Release */, 04A29D00147C080700B264EF /* Adhoc */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 379B692A177CAEA8001174E8 /* Build configuration list for PBXAggregateTarget "AFCache_universal" */ = { isa = XCConfigurationList; buildConfigurations = ( 379B6927177CAEA8001174E8 /* Debug */, 379B6928177CAEA8001174E8 /* Release */, 379B6929177CAEA8001174E8 /* Adhoc */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 051B38641328AACA0057F2F5 /* Project object */; } ================================================ FILE: AFCache.podspec ================================================ Pod::Spec.new do |s| s.name = "AFCache" s.version = "0.13.0" s.summary = "AFCache is an HTTP disk cache for use on iPhone/iPad and OSX." s.description = <<-DESC AFCache is an HTTP disk cache for use on iPhone/iPad and OSX. It can be linked as a static library or as a framework. The cache was initially written because on iOS, NSURLCache ignores NSURLCacheStorageAllowed and instead treats it as NSURLCacheStorageAllowedInMemoryOnly which is pretty useless for a persistent cache. DESC s.homepage = "https://github.com/artifacts/AFCache" s.license = 'Apache' s.authors = { "Michael Markowski" => "m.markowski@artifacts.de", "Lars Blumberg" => "lars.blumberg@sprylab.com", "Nico Schmidt" => "", "Björn Kriews" => "bkr@jumper.org", "Christian Menschel" => "post@cmenschel.de" } s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.7' s.source = { :git => "https://github.com/artifacts/AFCache.git", :tag => s.version.to_s } s.source_files = 'src/shared/**/*.{h,m}', 'src/3rdparty/AFRegexString/**/*.{h,m}' s.ios.source_files = 'src/iOS/**/*.{h,m}' s.osx.source_files = 'src/OSX/**/*.{h,m}' s.exclude_files = 'src/OSX/afcpkg_main*', '**/main.{h,m}' s.requires_arc = true s.dependency 'ZipArchive', '~> 1.3.0' s.dependency 'VersionIntrospection', '~> 0.4.0' end ================================================ FILE: AFCache.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 04007352153242D400335735 /* AFCache+Mimetypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BADF132A291B0087CEA1 /* AFCache+Mimetypes.h */; }; 046BEFAB152D180A00FE16B8 /* AFCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BADD132A291B0087CEA1 /* AFCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; 046BEFAC152D180A00FE16B8 /* AFCacheableItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BAE4132A291B0087CEA1 /* AFCacheableItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; 046BEFAD152D180A00FE16B8 /* AFCacheableItemInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BAE8132A291B0087CEA1 /* AFCacheableItemInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 046BEFAE152D180A00FE16B8 /* AFMediaTypeParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C491F8150F9CB1009EDA8F /* AFMediaTypeParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 046BEFAF152D180A00FE16B8 /* AFURLCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BAEC132A291B0087CEA1 /* AFURLCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; 046BEFB0152D180A00FE16B8 /* AFHTTPURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C491FC150F9CBA009EDA8F /* AFHTTPURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; 046BEFB4152D180A00FE16B8 /* AFPackageInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BAEA132A291B0087CEA1 /* AFPackageInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 050D30B5132A276A003809FC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 050D30B4132A276A003809FC /* Cocoa.framework */; }; 050D30C7132A276A003809FC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 050D30B4132A276A003809FC /* Cocoa.framework */; }; 050D30CA132A276A003809FC /* AFCache.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 050D30B1132A276A003809FC /* AFCache.framework */; }; 0511C97815AC480500369FE4 /* AFCacheTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0511C97615AC480500369FE4 /* AFCacheTests.m */; }; 0527099617CE587C00CFFE63 /* AFCache.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 050D30B1132A276A003809FC /* AFCache.framework */; }; 055AAF5A13575581006E1CF9 /* AFCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BADE132A291B0087CEA1 /* AFCache.m */; }; 055AAF5B13575581006E1CF9 /* AFCache+Mimetypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAE0132A291B0087CEA1 /* AFCache+Mimetypes.m */; }; 055AAF5D13575581006E1CF9 /* AFCacheableItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAE5132A291B0087CEA1 /* AFCacheableItem.m */; }; 055AAF5E13575581006E1CF9 /* AFCacheableItem+Packaging.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAE7132A291B0087CEA1 /* AFCacheableItem+Packaging.m */; }; 055AAF5F13575581006E1CF9 /* AFCacheableItemInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAE9132A291B0087CEA1 /* AFCacheableItemInfo.m */; }; 055AAF6013575581006E1CF9 /* AFPackageInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAEB132A291B0087CEA1 /* AFPackageInfo.m */; }; 055AAF6113575581006E1CF9 /* AFURLCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAED132A291B0087CEA1 /* AFURLCache.m */; }; 055AAF6213575581006E1CF9 /* DateParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAF0132A291B0087CEA1 /* DateParser.m */; }; 055AAF6513575640006E1CF9 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 055AAF6413575640006E1CF9 /* Cocoa.framework */; }; 055AAF671357565B006E1CF9 /* AFRegexString.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BB09132A29370087CEA1 /* AFRegexString.m */; }; 056DD4CD1859AE0E004C7134 /* AFCachePackageCreator.m in Sources */ = {isa = PBXBuildFile; fileRef = 05238D0D151B6D880015D70E /* AFCachePackageCreator.m */; }; 056DD4CE1859AE13004C7134 /* AFCache+Packaging.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAE2132A291B0087CEA1 /* AFCache+Packaging.m */; }; 05C491FB150F9CB1009EDA8F /* AFMediaTypeParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C491F9150F9CB1009EDA8F /* AFMediaTypeParser.m */; }; 05C491FF150F9CBA009EDA8F /* AFHTTPURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C491FD150F9CBA009EDA8F /* AFHTTPURLProtocol.m */; }; 05C49201150F9D5C009EDA8F /* AFMediaTypeParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C491F8150F9CB1009EDA8F /* AFMediaTypeParser.h */; }; 05C49202150F9D67009EDA8F /* AFMediaTypeParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C491F9150F9CB1009EDA8F /* AFMediaTypeParser.m */; }; 05C9BAF3132A291B0087CEA1 /* AFCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BADE132A291B0087CEA1 /* AFCache.m */; }; 05C9BAF5132A291B0087CEA1 /* AFCache+Mimetypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAE0132A291B0087CEA1 /* AFCache+Mimetypes.m */; }; 05C9BAFA132A291B0087CEA1 /* AFCacheableItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAE5132A291B0087CEA1 /* AFCacheableItem.m */; }; 05C9BAFC132A291B0087CEA1 /* AFCacheableItem+Packaging.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAE7132A291B0087CEA1 /* AFCacheableItem+Packaging.m */; }; 05C9BAFE132A291B0087CEA1 /* AFCacheableItemInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAE9132A291B0087CEA1 /* AFCacheableItemInfo.m */; }; 05C9BB00132A291B0087CEA1 /* AFPackageInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAEB132A291B0087CEA1 /* AFPackageInfo.m */; }; 05C9BB02132A291B0087CEA1 /* AFURLCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAED132A291B0087CEA1 /* AFURLCache.m */; }; 05C9BB05132A291B0087CEA1 /* DateParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BAF0132A291B0087CEA1 /* DateParser.m */; }; 05C9BB19132A29370087CEA1 /* AFRegexString.m in Sources */ = {isa = PBXBuildFile; fileRef = 05C9BB09132A29370087CEA1 /* AFRegexString.m */; }; 05C9BB28132A2A540087CEA1 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05C9BB27132A2A540087CEA1 /* SystemConfiguration.framework */; }; 05C9BB2A132A2A880087CEA1 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 05C9BB29132A2A880087CEA1 /* libz.dylib */; }; 05C9BB6F132A30E60087CEA1 /* AFCacheLib.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BB6E132A30E60087CEA1 /* AFCacheLib.h */; settings = {ATTRIBUTES = (Public, ); }; }; 05FA233D1357515400050BCB /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05FA233C1357515400050BCB /* CoreFoundation.framework */; }; 05FA234A135751E100050BCB /* afcpkg_main.m in Sources */ = {isa = PBXBuildFile; fileRef = 05FA2349135751E100050BCB /* afcpkg_main.m */; }; 05FA23581357535400050BCB /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05FA23571357535400050BCB /* SystemConfiguration.framework */; }; 05FA235A1357536600050BCB /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 05FA23591357536600050BCB /* libz.dylib */; }; 05FA23601357539B00050BCB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 050D30B4132A276A003809FC /* Cocoa.framework */; }; 05FA236A1357539C00050BCB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 050D30B4132A276A003809FC /* Cocoa.framework */; }; 05FA236D1357539C00050BCB /* libAFCacheOSXStatic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05FA235F1357539B00050BCB /* libAFCacheOSXStatic.a */; }; 05FA23731357539C00050BCB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 05FA23711357539C00050BCB /* InfoPlist.strings */; }; 05FA23761357539C00050BCB /* AFCacheOSXStaticTests.h in Resources */ = {isa = PBXBuildFile; fileRef = 05FA23751357539C00050BCB /* AFCacheOSXStaticTests.h */; }; 05FA23781357539C00050BCB /* AFCacheOSXStaticTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 05FA23771357539C00050BCB /* AFCacheOSXStaticTests.m */; }; 05FA2380135753C500050BCB /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05FA237F135753C500050BCB /* SystemConfiguration.framework */; }; 05FA23831357540400050BCB /* AFCacheLib.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BB6E132A30E60087CEA1 /* AFCacheLib.h */; settings = {ATTRIBUTES = (Public, ); }; }; 05FA23841357543A00050BCB /* AFCache_Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BADC132A291B0087CEA1 /* AFCache_Logging.h */; }; 05FA23851357543D00050BCB /* AFCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BADD132A291B0087CEA1 /* AFCache.h */; }; 05FA23861357543F00050BCB /* AFCache+Mimetypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BADF132A291B0087CEA1 /* AFCache+Mimetypes.h */; }; 05FA23881357544200050BCB /* AFCache+PrivateAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BAE3132A291B0087CEA1 /* AFCache+PrivateAPI.h */; }; 05FA23891357544400050BCB /* AFCacheableItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BAE4132A291B0087CEA1 /* AFCacheableItem.h */; }; 05FA238B1357544B00050BCB /* AFCacheableItemInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BAE8132A291B0087CEA1 /* AFCacheableItemInfo.h */; }; 05FA238C1357544C00050BCB /* AFPackageInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BAEA132A291B0087CEA1 /* AFPackageInfo.h */; }; 05FA238D1357544D00050BCB /* AFURLCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BAEC132A291B0087CEA1 /* AFURLCache.h */; }; 05FA238F1357545000050BCB /* DateParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 05C9BAEF132A291B0087CEA1 /* DateParser.h */; }; 05FA23901357548D00050BCB /* libAFCacheOSXStatic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05FA235F1357539B00050BCB /* libAFCacheOSXStatic.a */; }; C73C71CC19816F13008EDA23 /* AFRequestConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = C73C71CA19816F13008EDA23 /* AFRequestConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; C73C71CD19816F13008EDA23 /* AFRequestConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = C73C71CA19816F13008EDA23 /* AFRequestConfiguration.h */; }; C73C71CE19816F13008EDA23 /* AFRequestConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = C73C71CB19816F13008EDA23 /* AFRequestConfiguration.m */; }; C73C71CF19816F13008EDA23 /* AFRequestConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = C73C71CB19816F13008EDA23 /* AFRequestConfiguration.m */; }; C7503D46198640AA0032E451 /* AFDownloadOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C7503D44198640AA0032E451 /* AFDownloadOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; C7503D47198640AA0032E451 /* AFDownloadOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C7503D44198640AA0032E451 /* AFDownloadOperation.h */; }; C7503D48198640AA0032E451 /* AFDownloadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = C7503D45198640AA0032E451 /* AFDownloadOperation.m */; }; C7503D49198640AA0032E451 /* AFDownloadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = C7503D45198640AA0032E451 /* AFDownloadOperation.m */; }; C765AB591CEB39F200A47B4A /* AFCache+FileAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = C765AB571CEB39F200A47B4A /* AFCache+FileAttributes.h */; }; C765AB5A1CEB39F200A47B4A /* AFCache+FileAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = C765AB581CEB39F200A47B4A /* AFCache+FileAttributes.m */; }; C765AB5D1CEB3BD500A47B4A /* AFCacheableItem+FileAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = C765AB5B1CEB3BD500A47B4A /* AFCacheableItem+FileAttributes.h */; }; C765AB5E1CEB3BD500A47B4A /* AFCacheableItem+FileAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = C765AB5C1CEB3BD500A47B4A /* AFCacheableItem+FileAttributes.m */; }; E369E20919B0711700EAC9FE /* AFCache+DeprecatedAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = E369E20719B0711700EAC9FE /* AFCache+DeprecatedAPI.h */; }; E369E20A19B0711700EAC9FE /* AFCache+DeprecatedAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = E369E20819B0711700EAC9FE /* AFCache+DeprecatedAPI.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 050D30C8132A276A003809FC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 050D30A7132A276A003809FC /* Project object */; proxyType = 1; remoteGlobalIDString = 050D30B0132A276A003809FC; remoteInfo = AFCache; }; 05FA236B1357539C00050BCB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 050D30A7132A276A003809FC /* Project object */; proxyType = 1; remoteGlobalIDString = 05FA235E1357539B00050BCB; remoteInfo = AFCacheOSXStatic; }; 05FA2391135754BE00050BCB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 050D30A7132A276A003809FC /* Project object */; proxyType = 1; remoteGlobalIDString = 05FA235E1357539B00050BCB; remoteInfo = AFCacheOSXStatic; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 0527099517CE586500CFFE63 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = "~/build_frameworks"; dstSubfolderSpec = 0; files = ( 0527099617CE587C00CFFE63 /* AFCache.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; 05FA23381357515400050BCB /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = /usr/share/man/man1/; dstSubfolderSpec = 0; files = ( ); runOnlyForDeploymentPostprocessing = 1; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 050D30B1132A276A003809FC /* AFCache.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AFCache.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 050D30B4132A276A003809FC /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 050D30B7132A276A003809FC /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 050D30B8132A276A003809FC /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 050D30B9132A276A003809FC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 050D30C6132A276A003809FC /* AFCacheTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AFCacheTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 050D30E4132A2821003809FC /* AFCache-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "AFCache-Info.plist"; path = "src/OSX/AFCache-Info.plist"; sourceTree = ""; }; 050D30E5132A2821003809FC /* AFCache-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AFCache-Prefix.pch"; path = "src/OSX/AFCache-Prefix.pch"; sourceTree = ""; }; 0511C97315AC480500369FE4 /* AFCacheTests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "AFCacheTests-Info.plist"; path = "AFCacheTests/AFCacheTests-Info.plist"; sourceTree = ""; }; 0511C97415AC480500369FE4 /* AFCacheTests-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AFCacheTests-Prefix.pch"; path = "AFCacheTests/AFCacheTests-Prefix.pch"; sourceTree = ""; }; 0511C97515AC480500369FE4 /* AFCacheTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFCacheTests.h; path = AFCacheTests/AFCacheTests.h; sourceTree = ""; }; 0511C97615AC480500369FE4 /* AFCacheTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFCacheTests.m; path = AFCacheTests/AFCacheTests.m; sourceTree = ""; }; 05238D0C151B6D880015D70E /* AFCachePackageCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFCachePackageCreator.h; path = src/shared/AFCachePackageCreator.h; sourceTree = ""; }; 05238D0D151B6D880015D70E /* AFCachePackageCreator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFCachePackageCreator.m; path = src/shared/AFCachePackageCreator.m; sourceTree = ""; }; 055AAF6413575640006E1CF9 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 05C491F8150F9CB1009EDA8F /* AFMediaTypeParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFMediaTypeParser.h; path = src/shared/AFMediaTypeParser.h; sourceTree = ""; }; 05C491F9150F9CB1009EDA8F /* AFMediaTypeParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFMediaTypeParser.m; path = src/shared/AFMediaTypeParser.m; sourceTree = ""; }; 05C491FC150F9CBA009EDA8F /* AFHTTPURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFHTTPURLProtocol.h; path = src/shared/AFHTTPURLProtocol.h; sourceTree = ""; }; 05C491FD150F9CBA009EDA8F /* AFHTTPURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFHTTPURLProtocol.m; path = src/shared/AFHTTPURLProtocol.m; sourceTree = ""; }; 05C9BADC132A291B0087CEA1 /* AFCache_Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFCache_Logging.h; path = src/shared/AFCache_Logging.h; sourceTree = ""; }; 05C9BADD132A291B0087CEA1 /* AFCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFCache.h; path = src/shared/AFCache.h; sourceTree = ""; }; 05C9BADE132A291B0087CEA1 /* AFCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFCache.m; path = src/shared/AFCache.m; sourceTree = ""; }; 05C9BADF132A291B0087CEA1 /* AFCache+Mimetypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AFCache+Mimetypes.h"; path = "src/shared/AFCache+Mimetypes.h"; sourceTree = ""; }; 05C9BAE0132A291B0087CEA1 /* AFCache+Mimetypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "AFCache+Mimetypes.m"; path = "src/shared/AFCache+Mimetypes.m"; sourceTree = ""; }; 05C9BAE1132A291B0087CEA1 /* AFCache+Packaging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AFCache+Packaging.h"; path = "src/shared/AFCache+Packaging.h"; sourceTree = ""; }; 05C9BAE2132A291B0087CEA1 /* AFCache+Packaging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "AFCache+Packaging.m"; path = "src/shared/AFCache+Packaging.m"; sourceTree = ""; }; 05C9BAE3132A291B0087CEA1 /* AFCache+PrivateAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AFCache+PrivateAPI.h"; path = "src/shared/AFCache+PrivateAPI.h"; sourceTree = ""; }; 05C9BAE4132A291B0087CEA1 /* AFCacheableItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFCacheableItem.h; path = src/shared/AFCacheableItem.h; sourceTree = ""; }; 05C9BAE5132A291B0087CEA1 /* AFCacheableItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFCacheableItem.m; path = src/shared/AFCacheableItem.m; sourceTree = ""; }; 05C9BAE6132A291B0087CEA1 /* AFCacheableItem+Packaging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AFCacheableItem+Packaging.h"; path = "src/shared/AFCacheableItem+Packaging.h"; sourceTree = ""; }; 05C9BAE7132A291B0087CEA1 /* AFCacheableItem+Packaging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "AFCacheableItem+Packaging.m"; path = "src/shared/AFCacheableItem+Packaging.m"; sourceTree = ""; }; 05C9BAE8132A291B0087CEA1 /* AFCacheableItemInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFCacheableItemInfo.h; path = src/shared/AFCacheableItemInfo.h; sourceTree = ""; }; 05C9BAE9132A291B0087CEA1 /* AFCacheableItemInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFCacheableItemInfo.m; path = src/shared/AFCacheableItemInfo.m; sourceTree = ""; }; 05C9BAEA132A291B0087CEA1 /* AFPackageInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFPackageInfo.h; path = src/shared/AFPackageInfo.h; sourceTree = ""; }; 05C9BAEB132A291B0087CEA1 /* AFPackageInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFPackageInfo.m; path = src/shared/AFPackageInfo.m; sourceTree = ""; }; 05C9BAEC132A291B0087CEA1 /* AFURLCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFURLCache.h; path = src/shared/AFURLCache.h; sourceTree = ""; }; 05C9BAED132A291B0087CEA1 /* AFURLCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFURLCache.m; path = src/shared/AFURLCache.m; sourceTree = ""; }; 05C9BAEF132A291B0087CEA1 /* DateParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DateParser.h; path = src/shared/DateParser.h; sourceTree = ""; }; 05C9BAF0132A291B0087CEA1 /* DateParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DateParser.m; path = src/shared/DateParser.m; sourceTree = ""; }; 05C9BB08132A29370087CEA1 /* AFRegexString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFRegexString.h; sourceTree = ""; }; 05C9BB09132A29370087CEA1 /* AFRegexString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFRegexString.m; sourceTree = ""; }; 05C9BB27132A2A540087CEA1 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 05C9BB29132A2A880087CEA1 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 05C9BB6E132A30E60087CEA1 /* AFCacheLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFCacheLib.h; path = release/AFCacheLib.h; sourceTree = ""; }; 05FA233A1357515400050BCB /* afcpkg */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = afcpkg; sourceTree = BUILT_PRODUCTS_DIR; }; 05FA233C1357515400050BCB /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 05FA2348135751E100050BCB /* afcpkg_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = afcpkg_main.h; path = src/OSX/afcpkg_main.h; sourceTree = ""; }; 05FA2349135751E100050BCB /* afcpkg_main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = afcpkg_main.m; path = src/OSX/afcpkg_main.m; sourceTree = ""; }; 05FA23571357535400050BCB /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 05FA23591357536600050BCB /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 05FA235F1357539B00050BCB /* libAFCacheOSXStatic.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libAFCacheOSXStatic.a; sourceTree = BUILT_PRODUCTS_DIR; }; 05FA23631357539C00050BCB /* AFCacheOSXStatic-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AFCacheOSXStatic-Prefix.pch"; sourceTree = ""; }; 05FA23691357539C00050BCB /* AFCacheOSXStaticTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AFCacheOSXStaticTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 05FA23701357539C00050BCB /* AFCacheOSXStaticTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "AFCacheOSXStaticTests-Info.plist"; sourceTree = ""; }; 05FA23721357539C00050BCB /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 05FA23741357539C00050BCB /* AFCacheOSXStaticTests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AFCacheOSXStaticTests-Prefix.pch"; sourceTree = ""; }; 05FA23751357539C00050BCB /* AFCacheOSXStaticTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AFCacheOSXStaticTests.h; sourceTree = ""; }; 05FA23771357539C00050BCB /* AFCacheOSXStaticTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AFCacheOSXStaticTests.m; sourceTree = ""; }; 05FA237F135753C500050BCB /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; C73C71CA19816F13008EDA23 /* AFRequestConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFRequestConfiguration.h; path = src/shared/AFRequestConfiguration.h; sourceTree = ""; }; C73C71CB19816F13008EDA23 /* AFRequestConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFRequestConfiguration.m; path = src/shared/AFRequestConfiguration.m; sourceTree = ""; }; C7503D44198640AA0032E451 /* AFDownloadOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AFDownloadOperation.h; path = src/shared/AFDownloadOperation.h; sourceTree = ""; }; C7503D45198640AA0032E451 /* AFDownloadOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AFDownloadOperation.m; path = src/shared/AFDownloadOperation.m; sourceTree = ""; }; C765AB571CEB39F200A47B4A /* AFCache+FileAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AFCache+FileAttributes.h"; path = "src/shared/AFCache+FileAttributes.h"; sourceTree = ""; }; C765AB581CEB39F200A47B4A /* AFCache+FileAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "AFCache+FileAttributes.m"; path = "src/shared/AFCache+FileAttributes.m"; sourceTree = ""; }; C765AB5B1CEB3BD500A47B4A /* AFCacheableItem+FileAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AFCacheableItem+FileAttributes.h"; path = "src/shared/AFCacheableItem+FileAttributes.h"; sourceTree = ""; }; C765AB5C1CEB3BD500A47B4A /* AFCacheableItem+FileAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "AFCacheableItem+FileAttributes.m"; path = "src/shared/AFCacheableItem+FileAttributes.m"; sourceTree = ""; }; E369E20719B0711700EAC9FE /* AFCache+DeprecatedAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "AFCache+DeprecatedAPI.h"; path = "src/shared/AFCache+DeprecatedAPI.h"; sourceTree = ""; }; E369E20819B0711700EAC9FE /* AFCache+DeprecatedAPI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "AFCache+DeprecatedAPI.m"; path = "src/shared/AFCache+DeprecatedAPI.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 050D30AD132A276A003809FC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 05C9BB2A132A2A880087CEA1 /* libz.dylib in Frameworks */, 05C9BB28132A2A540087CEA1 /* SystemConfiguration.framework in Frameworks */, 050D30B5132A276A003809FC /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 050D30C2132A276A003809FC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 050D30C7132A276A003809FC /* Cocoa.framework in Frameworks */, 050D30CA132A276A003809FC /* AFCache.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 05FA23371357515400050BCB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 055AAF6513575640006E1CF9 /* Cocoa.framework in Frameworks */, 05FA23901357548D00050BCB /* libAFCacheOSXStatic.a in Frameworks */, 05FA235A1357536600050BCB /* libz.dylib in Frameworks */, 05FA23581357535400050BCB /* SystemConfiguration.framework in Frameworks */, 05FA233D1357515400050BCB /* CoreFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 05FA235C1357539B00050BCB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 05FA2380135753C500050BCB /* SystemConfiguration.framework in Frameworks */, 05FA23601357539B00050BCB /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 05FA23651357539C00050BCB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 05FA236A1357539C00050BCB /* Cocoa.framework in Frameworks */, 05FA236D1357539C00050BCB /* libAFCacheOSXStatic.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 050D30A5132A276A003809FC = { isa = PBXGroup; children = ( 05A098F713C43BEF00BC9572 /* afcpkg */, 05A098F113C43BCE00BC9572 /* AFCacheTests */, 05A098EA13C43B8E00BC9572 /* src */, 055AAF6413575640006E1CF9 /* Cocoa.framework */, 05FA235F1357539B00050BCB /* libAFCacheOSXStatic.a */, 05FA237F135753C500050BCB /* SystemConfiguration.framework */, 05FA23591357536600050BCB /* libz.dylib */, 05FA23571357535400050BCB /* SystemConfiguration.framework */, 05C9BB6D132A30DA0087CEA1 /* api */, 05C9BB29132A2A880087CEA1 /* libz.dylib */, 05C9BB27132A2A540087CEA1 /* SystemConfiguration.framework */, 05FA23611357539B00050BCB /* AFCacheOSXStatic */, 05FA236E1357539C00050BCB /* AFCacheOSXStaticTests */, 050D30B3132A276A003809FC /* Frameworks */, 050D30B2132A276A003809FC /* Products */, ); sourceTree = ""; }; 050D30B2132A276A003809FC /* Products */ = { isa = PBXGroup; children = ( 050D30B1132A276A003809FC /* AFCache.framework */, 050D30C6132A276A003809FC /* AFCacheTests.octest */, 05FA233A1357515400050BCB /* afcpkg */, 05FA23691357539C00050BCB /* AFCacheOSXStaticTests.octest */, ); name = Products; sourceTree = ""; }; 050D30B3132A276A003809FC /* Frameworks */ = { isa = PBXGroup; children = ( 050D30B4132A276A003809FC /* Cocoa.framework */, 05FA233C1357515400050BCB /* CoreFoundation.framework */, 050D30B6132A276A003809FC /* Other Frameworks */, ); name = Frameworks; sourceTree = ""; }; 050D30B6132A276A003809FC /* Other Frameworks */ = { isa = PBXGroup; children = ( 050D30B7132A276A003809FC /* AppKit.framework */, 050D30B8132A276A003809FC /* CoreData.framework */, 050D30B9132A276A003809FC /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = ""; }; 05238D10151B6DB90015D70E /* packaging */ = { isa = PBXGroup; children = ( 05238D0C151B6D880015D70E /* AFCachePackageCreator.h */, 05238D0D151B6D880015D70E /* AFCachePackageCreator.m */, 05C9BAE1132A291B0087CEA1 /* AFCache+Packaging.h */, 05C9BAE2132A291B0087CEA1 /* AFCache+Packaging.m */, 05C9BAE6132A291B0087CEA1 /* AFCacheableItem+Packaging.h */, 05C9BAE7132A291B0087CEA1 /* AFCacheableItem+Packaging.m */, 05C9BAEA132A291B0087CEA1 /* AFPackageInfo.h */, 05C9BAEB132A291B0087CEA1 /* AFPackageInfo.m */, ); name = packaging; sourceTree = ""; }; 05238D11151B6DC60015D70E /* URLProtocol */ = { isa = PBXGroup; children = ( 05C491FC150F9CBA009EDA8F /* AFHTTPURLProtocol.h */, 05C491FD150F9CBA009EDA8F /* AFHTTPURLProtocol.m */, ); name = URLProtocol; sourceTree = ""; }; 05238D12151B6DED0015D70E /* URL Cache */ = { isa = PBXGroup; children = ( 05C9BAEC132A291B0087CEA1 /* AFURLCache.h */, 05C9BAED132A291B0087CEA1 /* AFURLCache.m */, ); name = "URL Cache"; sourceTree = ""; }; 05238D13151B6E2D0015D70E /* MimeTypes */ = { isa = PBXGroup; children = ( 05C491F8150F9CB1009EDA8F /* AFMediaTypeParser.h */, 05C491F9150F9CB1009EDA8F /* AFMediaTypeParser.m */, 05C9BADF132A291B0087CEA1 /* AFCache+Mimetypes.h */, 05C9BAE0132A291B0087CEA1 /* AFCache+Mimetypes.m */, ); name = MimeTypes; sourceTree = ""; }; 05238D14151B6E470015D70E /* core */ = { isa = PBXGroup; children = ( 05C9BADD132A291B0087CEA1 /* AFCache.h */, 05C9BADE132A291B0087CEA1 /* AFCache.m */, C765AB571CEB39F200A47B4A /* AFCache+FileAttributes.h */, C765AB581CEB39F200A47B4A /* AFCache+FileAttributes.m */, 05C9BAE3132A291B0087CEA1 /* AFCache+PrivateAPI.h */, 05C9BAE4132A291B0087CEA1 /* AFCacheableItem.h */, 05C9BAE5132A291B0087CEA1 /* AFCacheableItem.m */, C765AB5B1CEB3BD500A47B4A /* AFCacheableItem+FileAttributes.h */, C765AB5C1CEB3BD500A47B4A /* AFCacheableItem+FileAttributes.m */, 05C9BAE8132A291B0087CEA1 /* AFCacheableItemInfo.h */, 05C9BAE9132A291B0087CEA1 /* AFCacheableItemInfo.m */, C73C71CA19816F13008EDA23 /* AFRequestConfiguration.h */, C73C71CB19816F13008EDA23 /* AFRequestConfiguration.m */, C7503D44198640AA0032E451 /* AFDownloadOperation.h */, C7503D45198640AA0032E451 /* AFDownloadOperation.m */, ); name = core; sourceTree = ""; }; 05238D15151B6E5C0015D70E /* util */ = { isa = PBXGroup; children = ( 05C9BADC132A291B0087CEA1 /* AFCache_Logging.h */, 05C9BAEF132A291B0087CEA1 /* DateParser.h */, 05C9BAF0132A291B0087CEA1 /* DateParser.m */, ); name = util; sourceTree = ""; }; 05A098EA13C43B8E00BC9572 /* src */ = { isa = PBXGroup; children = ( 05A098ED13C43BA200BC9572 /* shared */, 05A098EE13C43BB100BC9572 /* OSX */, 05C9BB06132A29370087CEA1 /* 3rdparty */, ); name = src; sourceTree = ""; }; 05A098ED13C43BA200BC9572 /* shared */ = { isa = PBXGroup; children = ( E369E20619B070FB00EAC9FE /* Deprecated */, 05238D15151B6E5C0015D70E /* util */, 05238D14151B6E470015D70E /* core */, 05238D13151B6E2D0015D70E /* MimeTypes */, 05238D12151B6DED0015D70E /* URL Cache */, 05238D11151B6DC60015D70E /* URLProtocol */, 05238D10151B6DB90015D70E /* packaging */, ); name = shared; sourceTree = ""; }; 05A098EE13C43BB100BC9572 /* OSX */ = { isa = PBXGroup; children = ( 050D30E4132A2821003809FC /* AFCache-Info.plist */, 050D30E5132A2821003809FC /* AFCache-Prefix.pch */, ); name = OSX; sourceTree = ""; }; 05A098F113C43BCE00BC9572 /* AFCacheTests */ = { isa = PBXGroup; children = ( 0511C97315AC480500369FE4 /* AFCacheTests-Info.plist */, 0511C97415AC480500369FE4 /* AFCacheTests-Prefix.pch */, 0511C97515AC480500369FE4 /* AFCacheTests.h */, 0511C97615AC480500369FE4 /* AFCacheTests.m */, ); name = AFCacheTests; sourceTree = ""; }; 05A098F713C43BEF00BC9572 /* afcpkg */ = { isa = PBXGroup; children = ( 05FA2348135751E100050BCB /* afcpkg_main.h */, 05FA2349135751E100050BCB /* afcpkg_main.m */, ); name = afcpkg; sourceTree = ""; }; 05C9BB06132A29370087CEA1 /* 3rdparty */ = { isa = PBXGroup; children = ( 05C9BB07132A29370087CEA1 /* AFRegexString */, ); name = 3rdparty; path = src/3rdparty; sourceTree = ""; }; 05C9BB07132A29370087CEA1 /* AFRegexString */ = { isa = PBXGroup; children = ( 05C9BB08132A29370087CEA1 /* AFRegexString.h */, 05C9BB09132A29370087CEA1 /* AFRegexString.m */, ); path = AFRegexString; sourceTree = ""; }; 05C9BB6D132A30DA0087CEA1 /* api */ = { isa = PBXGroup; children = ( 05C9BB6E132A30E60087CEA1 /* AFCacheLib.h */, ); name = api; sourceTree = ""; }; 05FA23611357539B00050BCB /* AFCacheOSXStatic */ = { isa = PBXGroup; children = ( 05FA23621357539C00050BCB /* Supporting Files */, ); path = AFCacheOSXStatic; sourceTree = ""; }; 05FA23621357539C00050BCB /* Supporting Files */ = { isa = PBXGroup; children = ( 05FA23631357539C00050BCB /* AFCacheOSXStatic-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; 05FA236E1357539C00050BCB /* AFCacheOSXStaticTests */ = { isa = PBXGroup; children = ( 05FA23751357539C00050BCB /* AFCacheOSXStaticTests.h */, 05FA23771357539C00050BCB /* AFCacheOSXStaticTests.m */, 05FA236F1357539C00050BCB /* Supporting Files */, ); path = AFCacheOSXStaticTests; sourceTree = ""; }; 05FA236F1357539C00050BCB /* Supporting Files */ = { isa = PBXGroup; children = ( 05FA23701357539C00050BCB /* AFCacheOSXStaticTests-Info.plist */, 05FA23711357539C00050BCB /* InfoPlist.strings */, 05FA23741357539C00050BCB /* AFCacheOSXStaticTests-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; E369E20619B070FB00EAC9FE /* Deprecated */ = { isa = PBXGroup; children = ( E369E20719B0711700EAC9FE /* AFCache+DeprecatedAPI.h */, E369E20819B0711700EAC9FE /* AFCache+DeprecatedAPI.m */, ); name = Deprecated; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 050D30AE132A276A003809FC /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 05C9BB6F132A30E60087CEA1 /* AFCacheLib.h in Headers */, 046BEFAB152D180A00FE16B8 /* AFCache.h in Headers */, C765AB5D1CEB3BD500A47B4A /* AFCacheableItem+FileAttributes.h in Headers */, 046BEFAC152D180A00FE16B8 /* AFCacheableItem.h in Headers */, 046BEFAD152D180A00FE16B8 /* AFCacheableItemInfo.h in Headers */, 046BEFAE152D180A00FE16B8 /* AFMediaTypeParser.h in Headers */, 046BEFAF152D180A00FE16B8 /* AFURLCache.h in Headers */, 046BEFB0152D180A00FE16B8 /* AFHTTPURLProtocol.h in Headers */, 046BEFB4152D180A00FE16B8 /* AFPackageInfo.h in Headers */, C7503D46198640AA0032E451 /* AFDownloadOperation.h in Headers */, C73C71CC19816F13008EDA23 /* AFRequestConfiguration.h in Headers */, 04007352153242D400335735 /* AFCache+Mimetypes.h in Headers */, E369E20919B0711700EAC9FE /* AFCache+DeprecatedAPI.h in Headers */, C765AB591CEB39F200A47B4A /* AFCache+FileAttributes.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; 05FA235D1357539B00050BCB /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 05FA23831357540400050BCB /* AFCacheLib.h in Headers */, C73C71CD19816F13008EDA23 /* AFRequestConfiguration.h in Headers */, 05FA23841357543A00050BCB /* AFCache_Logging.h in Headers */, 05FA23891357544400050BCB /* AFCacheableItem.h in Headers */, 05FA238B1357544B00050BCB /* AFCacheableItemInfo.h in Headers */, 05FA238C1357544C00050BCB /* AFPackageInfo.h in Headers */, 05FA238F1357545000050BCB /* DateParser.h in Headers */, 05FA238D1357544D00050BCB /* AFURLCache.h in Headers */, C7503D47198640AA0032E451 /* AFDownloadOperation.h in Headers */, 05FA23881357544200050BCB /* AFCache+PrivateAPI.h in Headers */, 05FA23851357543D00050BCB /* AFCache.h in Headers */, 05C49201150F9D5C009EDA8F /* AFMediaTypeParser.h in Headers */, 05FA23861357543F00050BCB /* AFCache+Mimetypes.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 050D30B0132A276A003809FC /* AFCache */ = { isa = PBXNativeTarget; buildConfigurationList = 050D30D8132A276A003809FC /* Build configuration list for PBXNativeTarget "AFCache" */; buildPhases = ( 050D30AC132A276A003809FC /* Sources */, 050D30AD132A276A003809FC /* Frameworks */, 05C9BB70132A310B0087CEA1 /* ShellScript */, 050D30AE132A276A003809FC /* Headers */, 050D30AF132A276A003809FC /* Resources */, 0527099517CE586500CFFE63 /* CopyFiles */, ); buildRules = ( ); dependencies = ( ); name = AFCache; productName = AFCache; productReference = 050D30B1132A276A003809FC /* AFCache.framework */; productType = "com.apple.product-type.framework"; }; 050D30C5132A276A003809FC /* AFCacheTests */ = { isa = PBXNativeTarget; buildConfigurationList = 050D30DB132A276A003809FC /* Build configuration list for PBXNativeTarget "AFCacheTests" */; buildPhases = ( 050D30C1132A276A003809FC /* Sources */, 050D30C2132A276A003809FC /* Frameworks */, 050D30C3132A276A003809FC /* Resources */, 050D30C4132A276A003809FC /* ShellScript */, ); buildRules = ( ); dependencies = ( 050D30C9132A276A003809FC /* PBXTargetDependency */, ); name = AFCacheTests; productName = AFCacheTests; productReference = 050D30C6132A276A003809FC /* AFCacheTests.octest */; productType = "com.apple.product-type.bundle.ocunit-test"; }; 05FA23391357515400050BCB /* afcpkg */ = { isa = PBXNativeTarget; buildConfigurationList = 05FA23441357515400050BCB /* Build configuration list for PBXNativeTarget "afcpkg" */; buildPhases = ( 05FA23361357515400050BCB /* Sources */, 05FA23371357515400050BCB /* Frameworks */, 05FA23381357515400050BCB /* CopyFiles */, ); buildRules = ( ); dependencies = ( 05FA2392135754BE00050BCB /* PBXTargetDependency */, ); name = afcpkg; productName = afcpkg; productReference = 05FA233A1357515400050BCB /* afcpkg */; productType = "com.apple.product-type.tool"; }; 05FA235E1357539B00050BCB /* AFCacheOSXStatic */ = { isa = PBXNativeTarget; buildConfigurationList = 05FA23791357539C00050BCB /* Build configuration list for PBXNativeTarget "AFCacheOSXStatic" */; buildPhases = ( 05FA235B1357539B00050BCB /* Sources */, 05FA2382135753E800050BCB /* ShellScript */, 05FA235C1357539B00050BCB /* Frameworks */, 05FA235D1357539B00050BCB /* Headers */, ); buildRules = ( ); dependencies = ( ); name = AFCacheOSXStatic; productName = AFCacheOSXStatic; productReference = 05FA235F1357539B00050BCB /* libAFCacheOSXStatic.a */; productType = "com.apple.product-type.library.static"; }; 05FA23681357539C00050BCB /* AFCacheOSXStaticTests */ = { isa = PBXNativeTarget; buildConfigurationList = 05FA237C1357539C00050BCB /* Build configuration list for PBXNativeTarget "AFCacheOSXStaticTests" */; buildPhases = ( 05FA23641357539C00050BCB /* Sources */, 05FA23651357539C00050BCB /* Frameworks */, 05FA23661357539C00050BCB /* Resources */, 05FA23671357539C00050BCB /* ShellScript */, ); buildRules = ( ); dependencies = ( 05FA236C1357539C00050BCB /* PBXTargetDependency */, ); name = AFCacheOSXStaticTests; productName = AFCacheOSXStaticTests; productReference = 05FA23691357539C00050BCB /* AFCacheOSXStaticTests.octest */; productType = "com.apple.product-type.bundle.ocunit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 050D30A7132A276A003809FC /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0460; ORGANIZATIONNAME = "Artifacts - Fine Software Development"; }; buildConfigurationList = 050D30AA132A276A003809FC /* Build configuration list for PBXProject "AFCache" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 050D30A5132A276A003809FC; productRefGroup = 050D30B2132A276A003809FC /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 050D30B0132A276A003809FC /* AFCache */, 050D30C5132A276A003809FC /* AFCacheTests */, 05FA23391357515400050BCB /* afcpkg */, 05FA235E1357539B00050BCB /* AFCacheOSXStatic */, 05FA23681357539C00050BCB /* AFCacheOSXStaticTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 050D30AF132A276A003809FC /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 050D30C3132A276A003809FC /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 05FA23661357539C00050BCB /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 05FA23731357539C00050BCB /* InfoPlist.strings in Resources */, 05FA23761357539C00050BCB /* AFCacheOSXStaticTests.h in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 050D30C4132A276A003809FC /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; }; 05C9BB70132A310B0087CEA1 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "$(SRCROOT)/src/shared/AFCacheableItemInfo.h", "$(SRCROOT)/src/shared/AFCache.h", "$(SRCROOT)/src/shared/AFCacheableItem.h", "$(SRCROOT)/src/shared/AFURLCache.h", "$(SRCROOT)/src/shared/AFCacheableItem+Packaging.h", "$(SRCROOT)/src/shared/AFPackageInfo.h", "$(SRCROOT)/src/shared/AFCache+Packaging.h", "$(SRCROOT)/src/shared/AFMediaTypeParser.h", "$(SRCROOT)/src/shared/AFCachePackageCreator.h", "$(SRCROOT)/src/shared/AFHTTPURLProtocol.h", ); outputPaths = ( "$(SRCROOT)/release/AFCacheLib.h", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "cd scripts\n./updateAPI.sh"; }; 05FA23671357539C00050BCB /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; }; 05FA2382135753E800050BCB /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "cd scripts\n./updateAPI.sh"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 050D30AC132A276A003809FC /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( C765AB5E1CEB3BD500A47B4A /* AFCacheableItem+FileAttributes.m in Sources */, C765AB5A1CEB39F200A47B4A /* AFCache+FileAttributes.m in Sources */, 05C9BAF3132A291B0087CEA1 /* AFCache.m in Sources */, 05C9BAF5132A291B0087CEA1 /* AFCache+Mimetypes.m in Sources */, 05C9BAFA132A291B0087CEA1 /* AFCacheableItem.m in Sources */, 05C9BAFC132A291B0087CEA1 /* AFCacheableItem+Packaging.m in Sources */, 05C9BAFE132A291B0087CEA1 /* AFCacheableItemInfo.m in Sources */, 05C9BB00132A291B0087CEA1 /* AFPackageInfo.m in Sources */, 05C9BB02132A291B0087CEA1 /* AFURLCache.m in Sources */, E369E20A19B0711700EAC9FE /* AFCache+DeprecatedAPI.m in Sources */, C7503D48198640AA0032E451 /* AFDownloadOperation.m in Sources */, 05C9BB05132A291B0087CEA1 /* DateParser.m in Sources */, 05C9BB19132A29370087CEA1 /* AFRegexString.m in Sources */, 05C491FB150F9CB1009EDA8F /* AFMediaTypeParser.m in Sources */, 05C491FF150F9CBA009EDA8F /* AFHTTPURLProtocol.m in Sources */, C73C71CE19816F13008EDA23 /* AFRequestConfiguration.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 050D30C1132A276A003809FC /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 0511C97815AC480500369FE4 /* AFCacheTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 05FA23361357515400050BCB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 05FA234A135751E100050BCB /* afcpkg_main.m in Sources */, 056DD4CE1859AE13004C7134 /* AFCache+Packaging.m in Sources */, 056DD4CD1859AE0E004C7134 /* AFCachePackageCreator.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 05FA235B1357539B00050BCB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( C7503D49198640AA0032E451 /* AFDownloadOperation.m in Sources */, 055AAF5A13575581006E1CF9 /* AFCache.m in Sources */, 055AAF5B13575581006E1CF9 /* AFCache+Mimetypes.m in Sources */, 055AAF5D13575581006E1CF9 /* AFCacheableItem.m in Sources */, 055AAF5E13575581006E1CF9 /* AFCacheableItem+Packaging.m in Sources */, C73C71CF19816F13008EDA23 /* AFRequestConfiguration.m in Sources */, 055AAF5F13575581006E1CF9 /* AFCacheableItemInfo.m in Sources */, 055AAF6013575581006E1CF9 /* AFPackageInfo.m in Sources */, 055AAF671357565B006E1CF9 /* AFRegexString.m in Sources */, 055AAF6113575581006E1CF9 /* AFURLCache.m in Sources */, 05C49202150F9D67009EDA8F /* AFMediaTypeParser.m in Sources */, 055AAF6213575581006E1CF9 /* DateParser.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 05FA23641357539C00050BCB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 05FA23781357539C00050BCB /* AFCacheOSXStaticTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 050D30C9132A276A003809FC /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 050D30B0132A276A003809FC /* AFCache */; targetProxy = 050D30C8132A276A003809FC /* PBXContainerItemProxy */; }; 05FA236C1357539C00050BCB /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 05FA235E1357539B00050BCB /* AFCacheOSXStatic */; targetProxy = 05FA236B1357539C00050BCB /* PBXContainerItemProxy */; }; 05FA2392135754BE00050BCB /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 05FA235E1357539B00050BCB /* AFCacheOSXStatic */; targetProxy = 05FA2391135754BE00050BCB /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 05FA23711357539C00050BCB /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 05FA23721357539C00050BCB /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 050D30D6132A276A003809FC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = "@rpath"; MACOSX_DEPLOYMENT_TARGET = ""; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; 050D30D7132A276A003809FC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_PATH = "@rpath"; MACOSX_DEPLOYMENT_TARGET = ""; SDKROOT = macosx; }; name = Release; }; 050D30D9132A276A003809FC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/OSX/AFCache-Prefix.pch"; INFOPLIST_FILE = "src/OSX/AFCache-Info.plist"; INSTALL_PATH = "@rpath"; MACOSX_DEPLOYMENT_TARGET = 10.8; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; WRAPPER_EXTENSION = framework; }; name = Debug; }; 050D30DA132A276A003809FC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "src/OSX/AFCache-Prefix.pch"; INFOPLIST_FILE = "src/OSX/AFCache-Info.plist"; INSTALL_PATH = "@rpath"; MACOSX_DEPLOYMENT_TARGET = 10.8; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; WRAPPER_EXTENSION = framework; }; name = Release; }; 050D30DC132A276A003809FC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheTests/AFCacheTests-Prefix.pch"; INFOPLIST_FILE = "AFCacheTests/AFCacheTests-Info.plist"; OTHER_LDFLAGS = ( "-framework", SenTestingKit, ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = octest; }; name = Debug; }; 050D30DD132A276A003809FC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheTests/AFCacheTests-Prefix.pch"; INFOPLIST_FILE = "AFCacheTests/AFCacheTests-Info.plist"; OTHER_LDFLAGS = ( "-framework", SenTestingKit, ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = octest; }; name = Release; }; 05FA23421357515400050BCB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 05FA23431357515400050BCB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_OBJC_EXCEPTIONS = YES; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; 05FA237A1357539C00050BCB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheOSXStatic/AFCacheOSXStatic-Prefix.pch"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 05FA237B1357539C00050BCB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheOSXStatic/AFCacheOSXStatic-Prefix.pch"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; 05FA237D1357539C00050BCB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheOSXStaticTests/AFCacheOSXStaticTests-Prefix.pch"; INFOPLIST_FILE = "AFCacheOSXStaticTests/AFCacheOSXStaticTests-Info.plist"; OTHER_LDFLAGS = ( "-framework", SenTestingKit, ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = octest; }; name = Debug; }; 05FA237E1357539C00050BCB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheOSXStaticTests/AFCacheOSXStaticTests-Prefix.pch"; INFOPLIST_FILE = "AFCacheOSXStaticTests/AFCacheOSXStaticTests-Info.plist"; OTHER_LDFLAGS = ( "-framework", SenTestingKit, ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = octest; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 050D30AA132A276A003809FC /* Build configuration list for PBXProject "AFCache" */ = { isa = XCConfigurationList; buildConfigurations = ( 050D30D6132A276A003809FC /* Debug */, 050D30D7132A276A003809FC /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 050D30D8132A276A003809FC /* Build configuration list for PBXNativeTarget "AFCache" */ = { isa = XCConfigurationList; buildConfigurations = ( 050D30D9132A276A003809FC /* Debug */, 050D30DA132A276A003809FC /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 050D30DB132A276A003809FC /* Build configuration list for PBXNativeTarget "AFCacheTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 050D30DC132A276A003809FC /* Debug */, 050D30DD132A276A003809FC /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 05FA23441357515400050BCB /* Build configuration list for PBXNativeTarget "afcpkg" */ = { isa = XCConfigurationList; buildConfigurations = ( 05FA23421357515400050BCB /* Debug */, 05FA23431357515400050BCB /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 05FA23791357539C00050BCB /* Build configuration list for PBXNativeTarget "AFCacheOSXStatic" */ = { isa = XCConfigurationList; buildConfigurations = ( 05FA237A1357539C00050BCB /* Debug */, 05FA237B1357539C00050BCB /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 05FA237C1357539C00050BCB /* Build configuration list for PBXNativeTarget "AFCacheOSXStaticTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 05FA237D1357539C00050BCB /* Debug */, 05FA237E1357539C00050BCB /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 050D30A7132A276A003809FC /* Project object */; } ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool/AFAppDelegate.h ================================================ // // AFAppDelegate.h // AFCacheTestTool // // Created by Michael Markowski on 01/08/14. // Copyright (c) 2014 artifacts Software GmbH & Co KG. All rights reserved. // #import @interface AFAppDelegate : NSObject @property (assign) IBOutlet NSWindow *window; @property (strong) IBOutlet NSTextField *URLTextField; @property (strong) IBOutlet NSTextView *responseTextView; @property (strong) IBOutlet NSButton *requestButton; @property (strong) IBOutlet NSArrayController *requestArrayController; @property (strong) IBOutlet NSTextField *numberOfRequestsTextField; @end ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool/AFAppDelegate.m ================================================ // // AFAppDelegate.m // AFCacheTestTool // // Created by Michael Markowski on 01/08/14. // Copyright (c) 2014 artifacts Software GmbH & Co KG. All rights reserved. // #import "AFAppDelegate.h" #import #import "AFRequestInfo.h" #define kLastURL @"lastURL" @implementation AFAppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSInteger num = [[[NSUserDefaults standardUserDefaults] valueForKey:@"numberOfRequests"] integerValue]; if (num == 0) { [[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInteger:1] forKey:@"numberOfRequests"]; } } - (void)applicationWillTerminate:(NSNotification *)notification { [[AFCache sharedInstance] archiveNow]; } - (IBAction)clearCacheAction:(id)sender { [[AFCache sharedInstance] invalidateAll]; [[AFCache sharedInstance] archiveNow]; } - (IBAction)performRequestAction:(id)sender { AFCache *cache = [AFCache sharedInstance]; NSString *URLString = [self.URLTextField stringValue]; if ([URLString length] == 0) { [[NSAlert alertWithMessageText:@"No URL given" defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"Please provide an URL"] runModal]; return; } NSURL *URL = [NSURL URLWithString:URLString]; if ([[URL absoluteString] length] == 0) { [[NSAlert alertWithMessageText:@"Invalid URL" defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"Please provide a valid URL"] runModal]; return; } NSInteger numberOfRequests = [[self.numberOfRequestsTextField stringValue] integerValue]; for (NSInteger i=0; i CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile CFBundleIdentifier de.artifacts.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright Copyright © 2014 artifacts Software GmbH & Co KG. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass NSApplication ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool/AFCacheTestTool-Prefix.pch ================================================ // // Prefix header // // The contents of this file are implicitly included at the beginning of every source file. // #ifdef __OBJC__ #import #endif ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool/AFRequestInfo.h ================================================ // // AFRequestInfo.h // AFCacheTestTool // // Created by Michael Markowski on 01/08/14. // Copyright (c) 2014 artifacts Software GmbH & Co KG. All rights reserved. // #import @interface AFRequestInfo : NSObject @property (nonatomic, strong) NSURL *requestURL; @property (nonatomic, strong) NSDate *requestTimestamp; @property (nonatomic, strong) NSString *requestHeader; @property (nonatomic, strong) NSDate *responseTimestamp; @property (nonatomic, strong) NSString *responseHeader; @property (nonatomic, strong) NSData *responseData; @property (nonatomic, strong) NSNumber *successful; @property (nonatomic, strong) NSString *cacheStatus; @property (nonatomic, strong) NSString *internalRequestType; @property (nonatomic, strong) NSNumber *servedFromCache; @property (nonatomic, strong) NSNumber *levelIndicatorValue; @end ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool/AFRequestInfo.m ================================================ // // AFRequestInfo.m // AFCacheTestTool // // Created by Michael Markowski on 01/08/14. // Copyright (c) 2014 artifacts Software GmbH & Co KG. All rights reserved. // #import "AFRequestInfo.h" @implementation AFRequestInfo @end ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool/Base.lproj/MainMenu.xib ================================================ Default Left to Right Right to Left Default Left to Right Right to Left ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "mac", "size" : "16x16", "scale" : "1x" }, { "idiom" : "mac", "size" : "16x16", "scale" : "2x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "1x" }, { "idiom" : "mac", "size" : "32x32", "scale" : "2x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "1x" }, { "idiom" : "mac", "size" : "128x128", "scale" : "2x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "1x" }, { "idiom" : "mac", "size" : "256x256", "scale" : "2x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "1x" }, { "idiom" : "mac", "size" : "512x512", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool/en.lproj/Credits.rtf ================================================ {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} {\colortbl;\red255\green255\blue255;} \paperw9840\paperh8400 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural \f0\b\fs24 \cf0 Engineering: \b0 \ Some people\ \ \b Human Interface Design: \b0 \ Some other people\ \ \b Testing: \b0 \ Hopefully not nobody\ \ \b Documentation: \b0 \ Whoever\ \ \b With special thanks to: \b0 \ Mom\ } ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool/main.m ================================================ // // main.m // AFCacheTestTool // // Created by Michael Markowski on 01/08/14. // Copyright (c) 2014 artifacts Software GmbH & Co KG. All rights reserved. // #import int main(int argc, const char * argv[]) { return NSApplicationMain(argc, argv); } ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 051A9826198B9CC0002B8F2C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051A9825198B9CC0002B8F2C /* Cocoa.framework */; }; 051A9830198B9CC0002B8F2C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 051A982E198B9CC0002B8F2C /* InfoPlist.strings */; }; 051A9832198B9CC0002B8F2C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 051A9831198B9CC0002B8F2C /* main.m */; }; 051A9836198B9CC0002B8F2C /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 051A9834198B9CC0002B8F2C /* Credits.rtf */; }; 051A9839198B9CC0002B8F2C /* AFAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 051A9838198B9CC0002B8F2C /* AFAppDelegate.m */; }; 051A983C198B9CC0002B8F2C /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 051A983A198B9CC0002B8F2C /* MainMenu.xib */; }; 051A983E198B9CC0002B8F2C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 051A983D198B9CC0002B8F2C /* Images.xcassets */; }; 051A9845198B9CC0002B8F2C /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051A9844198B9CC0002B8F2C /* XCTest.framework */; }; 051A9846198B9CC0002B8F2C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 051A9825198B9CC0002B8F2C /* Cocoa.framework */; }; 051A984E198B9CC0002B8F2C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 051A984C198B9CC0002B8F2C /* InfoPlist.strings */; }; 051A9850198B9CC0002B8F2C /* AFCacheTestToolTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 051A984F198B9CC0002B8F2C /* AFCacheTestToolTests.m */; }; 051A985B198B9EC6002B8F2C /* AFRequestInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 051A985A198B9EC6002B8F2C /* AFRequestInfo.m */; }; EA6AD3EEFC7B470998844126 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 74368053065E4745B9ADC686 /* libPods.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 051A9847198B9CC0002B8F2C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 051A981A198B9CC0002B8F2C /* Project object */; proxyType = 1; remoteGlobalIDString = 051A9821198B9CC0002B8F2C; remoteInfo = AFCacheTestTool; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 051A9822198B9CC0002B8F2C /* AFCacheTestTool.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AFCacheTestTool.app; sourceTree = BUILT_PRODUCTS_DIR; }; 051A9825198B9CC0002B8F2C /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 051A9828198B9CC0002B8F2C /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 051A9829198B9CC0002B8F2C /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 051A982A198B9CC0002B8F2C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 051A982D198B9CC0002B8F2C /* AFCacheTestTool-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "AFCacheTestTool-Info.plist"; sourceTree = ""; }; 051A982F198B9CC0002B8F2C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 051A9831198B9CC0002B8F2C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 051A9833198B9CC0002B8F2C /* AFCacheTestTool-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AFCacheTestTool-Prefix.pch"; sourceTree = ""; }; 051A9835198B9CC0002B8F2C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 051A9837198B9CC0002B8F2C /* AFAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AFAppDelegate.h; sourceTree = ""; }; 051A9838198B9CC0002B8F2C /* AFAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AFAppDelegate.m; sourceTree = ""; }; 051A983B198B9CC0002B8F2C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 051A983D198B9CC0002B8F2C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 051A9843198B9CC0002B8F2C /* AFCacheTestToolTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AFCacheTestToolTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 051A9844198B9CC0002B8F2C /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 051A984B198B9CC0002B8F2C /* AFCacheTestToolTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "AFCacheTestToolTests-Info.plist"; sourceTree = ""; }; 051A984D198B9CC0002B8F2C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 051A984F198B9CC0002B8F2C /* AFCacheTestToolTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AFCacheTestToolTests.m; sourceTree = ""; }; 051A9859198B9EC6002B8F2C /* AFRequestInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFRequestInfo.h; sourceTree = ""; }; 051A985A198B9EC6002B8F2C /* AFRequestInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFRequestInfo.m; sourceTree = ""; }; 74368053065E4745B9ADC686 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; E925080856E94B16B60CE852 /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 051A981F198B9CC0002B8F2C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 051A9826198B9CC0002B8F2C /* Cocoa.framework in Frameworks */, EA6AD3EEFC7B470998844126 /* libPods.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 051A9840198B9CC0002B8F2C /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 051A9846198B9CC0002B8F2C /* Cocoa.framework in Frameworks */, 051A9845198B9CC0002B8F2C /* XCTest.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 051A9819198B9CC0002B8F2C = { isa = PBXGroup; children = ( 051A982B198B9CC0002B8F2C /* AFCacheTestTool */, 051A9849198B9CC0002B8F2C /* AFCacheTestToolTests */, 051A9824198B9CC0002B8F2C /* Frameworks */, 051A9823198B9CC0002B8F2C /* Products */, E925080856E94B16B60CE852 /* Pods.xcconfig */, ); sourceTree = ""; }; 051A9823198B9CC0002B8F2C /* Products */ = { isa = PBXGroup; children = ( 051A9822198B9CC0002B8F2C /* AFCacheTestTool.app */, 051A9843198B9CC0002B8F2C /* AFCacheTestToolTests.xctest */, ); name = Products; sourceTree = ""; }; 051A9824198B9CC0002B8F2C /* Frameworks */ = { isa = PBXGroup; children = ( 051A9825198B9CC0002B8F2C /* Cocoa.framework */, 051A9844198B9CC0002B8F2C /* XCTest.framework */, 051A9827198B9CC0002B8F2C /* Other Frameworks */, 74368053065E4745B9ADC686 /* libPods.a */, ); name = Frameworks; sourceTree = ""; }; 051A9827198B9CC0002B8F2C /* Other Frameworks */ = { isa = PBXGroup; children = ( 051A9828198B9CC0002B8F2C /* AppKit.framework */, 051A9829198B9CC0002B8F2C /* CoreData.framework */, 051A982A198B9CC0002B8F2C /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = ""; }; 051A982B198B9CC0002B8F2C /* AFCacheTestTool */ = { isa = PBXGroup; children = ( 051A9837198B9CC0002B8F2C /* AFAppDelegate.h */, 051A9838198B9CC0002B8F2C /* AFAppDelegate.m */, 051A983A198B9CC0002B8F2C /* MainMenu.xib */, 051A983D198B9CC0002B8F2C /* Images.xcassets */, 051A982C198B9CC0002B8F2C /* Supporting Files */, 051A9859198B9EC6002B8F2C /* AFRequestInfo.h */, 051A985A198B9EC6002B8F2C /* AFRequestInfo.m */, ); path = AFCacheTestTool; sourceTree = ""; }; 051A982C198B9CC0002B8F2C /* Supporting Files */ = { isa = PBXGroup; children = ( 051A982D198B9CC0002B8F2C /* AFCacheTestTool-Info.plist */, 051A982E198B9CC0002B8F2C /* InfoPlist.strings */, 051A9831198B9CC0002B8F2C /* main.m */, 051A9833198B9CC0002B8F2C /* AFCacheTestTool-Prefix.pch */, 051A9834198B9CC0002B8F2C /* Credits.rtf */, ); name = "Supporting Files"; sourceTree = ""; }; 051A9849198B9CC0002B8F2C /* AFCacheTestToolTests */ = { isa = PBXGroup; children = ( 051A984F198B9CC0002B8F2C /* AFCacheTestToolTests.m */, 051A984A198B9CC0002B8F2C /* Supporting Files */, ); path = AFCacheTestToolTests; sourceTree = ""; }; 051A984A198B9CC0002B8F2C /* Supporting Files */ = { isa = PBXGroup; children = ( 051A984B198B9CC0002B8F2C /* AFCacheTestToolTests-Info.plist */, 051A984C198B9CC0002B8F2C /* InfoPlist.strings */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 051A9821198B9CC0002B8F2C /* AFCacheTestTool */ = { isa = PBXNativeTarget; buildConfigurationList = 051A9853198B9CC0002B8F2C /* Build configuration list for PBXNativeTarget "AFCacheTestTool" */; buildPhases = ( B4B24EA3ADB74570BDDBE37D /* Check Pods Manifest.lock */, 051A981E198B9CC0002B8F2C /* Sources */, 051A981F198B9CC0002B8F2C /* Frameworks */, 051A9820198B9CC0002B8F2C /* Resources */, F4D6B24304744A7DA823A9BF /* Copy Pods Resources */, ); buildRules = ( ); dependencies = ( ); name = AFCacheTestTool; productName = AFCacheTestTool; productReference = 051A9822198B9CC0002B8F2C /* AFCacheTestTool.app */; productType = "com.apple.product-type.application"; }; 051A9842198B9CC0002B8F2C /* AFCacheTestToolTests */ = { isa = PBXNativeTarget; buildConfigurationList = 051A9856198B9CC0002B8F2C /* Build configuration list for PBXNativeTarget "AFCacheTestToolTests" */; buildPhases = ( 051A983F198B9CC0002B8F2C /* Sources */, 051A9840198B9CC0002B8F2C /* Frameworks */, 051A9841198B9CC0002B8F2C /* Resources */, ); buildRules = ( ); dependencies = ( 051A9848198B9CC0002B8F2C /* PBXTargetDependency */, ); name = AFCacheTestToolTests; productName = AFCacheTestToolTests; productReference = 051A9843198B9CC0002B8F2C /* AFCacheTestToolTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 051A981A198B9CC0002B8F2C /* Project object */ = { isa = PBXProject; attributes = { CLASSPREFIX = AF; LastUpgradeCheck = 0510; ORGANIZATIONNAME = "artifacts Software GmbH & Co KG"; TargetAttributes = { 051A9842198B9CC0002B8F2C = { TestTargetID = 051A9821198B9CC0002B8F2C; }; }; }; buildConfigurationList = 051A981D198B9CC0002B8F2C /* Build configuration list for PBXProject "AFCacheTestTool" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 051A9819198B9CC0002B8F2C; productRefGroup = 051A9823198B9CC0002B8F2C /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 051A9821198B9CC0002B8F2C /* AFCacheTestTool */, 051A9842198B9CC0002B8F2C /* AFCacheTestToolTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 051A9820198B9CC0002B8F2C /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 051A9830198B9CC0002B8F2C /* InfoPlist.strings in Resources */, 051A983E198B9CC0002B8F2C /* Images.xcassets in Resources */, 051A9836198B9CC0002B8F2C /* Credits.rtf in Resources */, 051A983C198B9CC0002B8F2C /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 051A9841198B9CC0002B8F2C /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 051A984E198B9CC0002B8F2C /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ B4B24EA3ADB74570BDDBE37D /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; F4D6B24304744A7DA823A9BF /* Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Copy Pods Resources"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 051A981E198B9CC0002B8F2C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 051A9832198B9CC0002B8F2C /* main.m in Sources */, 051A9839198B9CC0002B8F2C /* AFAppDelegate.m in Sources */, 051A985B198B9EC6002B8F2C /* AFRequestInfo.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 051A983F198B9CC0002B8F2C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 051A9850198B9CC0002B8F2C /* AFCacheTestToolTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 051A9848198B9CC0002B8F2C /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 051A9821198B9CC0002B8F2C /* AFCacheTestTool */; targetProxy = 051A9847198B9CC0002B8F2C /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 051A982E198B9CC0002B8F2C /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 051A982F198B9CC0002B8F2C /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; 051A9834198B9CC0002B8F2C /* Credits.rtf */ = { isa = PBXVariantGroup; children = ( 051A9835198B9CC0002B8F2C /* en */, ); name = Credits.rtf; sourceTree = ""; }; 051A983A198B9CC0002B8F2C /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( 051A983B198B9CC0002B8F2C /* Base */, ); name = MainMenu.xib; sourceTree = ""; }; 051A984C198B9CC0002B8F2C /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 051A984D198B9CC0002B8F2C /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 051A9851198B9CC0002B8F2C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; 051A9852198B9CC0002B8F2C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.9; SDKROOT = macosx; }; name = Release; }; 051A9854198B9CC0002B8F2C /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = E925080856E94B16B60CE852 /* Pods.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheTestTool/AFCacheTestTool-Prefix.pch"; INFOPLIST_FILE = "AFCacheTestTool/AFCacheTestTool-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; 051A9855198B9CC0002B8F2C /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = E925080856E94B16B60CE852 /* Pods.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheTestTool/AFCacheTestTool-Prefix.pch"; INFOPLIST_FILE = "AFCacheTestTool/AFCacheTestTool-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; 051A9857198B9CC0002B8F2C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/AFCacheTestTool.app/Contents/MacOS/AFCacheTestTool"; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheTestTool/AFCacheTestTool-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = "AFCacheTestToolTests/AFCacheTestToolTests-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; }; name = Debug; }; 051A9858198B9CC0002B8F2C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/AFCacheTestTool.app/Contents/MacOS/AFCacheTestTool"; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheTestTool/AFCacheTestTool-Prefix.pch"; INFOPLIST_FILE = "AFCacheTestToolTests/AFCacheTestToolTests-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUNDLE_LOADER)"; WRAPPER_EXTENSION = xctest; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 051A981D198B9CC0002B8F2C /* Build configuration list for PBXProject "AFCacheTestTool" */ = { isa = XCConfigurationList; buildConfigurations = ( 051A9851198B9CC0002B8F2C /* Debug */, 051A9852198B9CC0002B8F2C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 051A9853198B9CC0002B8F2C /* Build configuration list for PBXNativeTarget "AFCacheTestTool" */ = { isa = XCConfigurationList; buildConfigurations = ( 051A9854198B9CC0002B8F2C /* Debug */, 051A9855198B9CC0002B8F2C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 051A9856198B9CC0002B8F2C /* Build configuration list for PBXNativeTarget "AFCacheTestToolTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 051A9857198B9CC0002B8F2C /* Debug */, 051A9858198B9CC0002B8F2C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 051A981A198B9CC0002B8F2C /* Project object */; } ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestTool.xcworkspace/xcshareddata/AFCacheTestTool.xccheckout ================================================ IDESourceControlProjectFavoriteDictionaryKey IDESourceControlProjectIdentifier 29FA1447-CDD4-463F-A188-DF885F812EBE IDESourceControlProjectName AFCacheTestTool IDESourceControlProjectOriginsDictionary 7A487629-3C5A-4DE8-A9C5-F518AD6494D8 ssh://github.com/artifacts/AFCache.git IDESourceControlProjectPath AFCacheTestTool-OSX/AFCacheTestTool.xcworkspace IDESourceControlProjectRelativeInstallPathDictionary 7A487629-3C5A-4DE8-A9C5-F518AD6494D8 ../.. IDESourceControlProjectURL ssh://github.com/artifacts/AFCache.git IDESourceControlProjectVersion 110 IDESourceControlProjectWCCIdentifier 7A487629-3C5A-4DE8-A9C5-F518AD6494D8 IDESourceControlProjectWCConfigurations IDESourceControlRepositoryExtensionIdentifierKey public.vcs.git IDESourceControlWCCIdentifierKey 7A487629-3C5A-4DE8-A9C5-F518AD6494D8 IDESourceControlWCCName AFCache ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestToolTests/AFCacheTestToolTests-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier de.artifacts.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestToolTests/AFCacheTestToolTests.m ================================================ // // AFCacheTestToolTests.m // AFCacheTestToolTests // // Created by Michael Markowski on 01/08/14. // Copyright (c) 2014 artifacts Software GmbH & Co KG. All rights reserved. // #import @interface AFCacheTestToolTests : XCTestCase @end @implementation AFCacheTestToolTests - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. } - (void)tearDown { // Put teardown code here. This method is called after the invocation of each test method in the class. [super tearDown]; } - (void)testExample { XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); } @end ================================================ FILE: AFCacheTestTool-OSX/AFCacheTestToolTests/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: AFCacheTestTool-OSX/Podfile ================================================ platform :osx, '10.9' pod 'AFCache', :path => '..' ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/AFCacheTestTool-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles CFBundleIdentifier de.artifacts.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIMainStoryboardFile MainStoryboard UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/AFCacheTestTool-Prefix.pch ================================================ // // Prefix header for all source files of the 'AFCacheTestTool' target in the 'AFCacheTestTool' project // #import #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/AppDelegate.h ================================================ // // AppDelegate.h // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/AppDelegate.m ================================================ // // AppDelegate.m // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import "AppDelegate.h" @implementation AppDelegate @synthesize window = _window; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; splitViewController.delegate = (id)navigationController.topViewController; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ } - (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. */ } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. */ } - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ } - (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. */ } @end ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/DetailViewController.h ================================================ // // DetailViewController.h // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import @interface DetailViewController : UIViewController @property (strong, nonatomic) id detailItem; @property (strong, nonatomic) IBOutlet UILabel *detailDescriptionLabel; @end ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/DetailViewController.m ================================================ // // DetailViewController.m // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import "DetailViewController.h" @interface DetailViewController () @property (strong, nonatomic) UIPopoverController *masterPopoverController; - (void)configureView; @end @implementation DetailViewController @synthesize detailItem = _detailItem; @synthesize detailDescriptionLabel = _detailDescriptionLabel; @synthesize masterPopoverController = _masterPopoverController; #pragma mark - Managing the detail item - (void)setDetailItem:(id)newDetailItem { if (_detailItem != newDetailItem) { _detailItem = newDetailItem; // Update the view. [self configureView]; } if (self.masterPopoverController != nil) { [self.masterPopoverController dismissPopoverAnimated:YES]; } } - (void)configureView { // Update the user interface for the detail item. if (self.detailItem) { self.detailDescriptionLabel.text = [self.detailItem description]; } } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self configureView]; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; } #pragma mark - Split view - (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController { barButtonItem.title = NSLocalizedString(@"Master", @"Master"); [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; self.masterPopoverController = popoverController; } - (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem { // Called when the view is shown again in the split view, invalidating the button and popover controller. [self.navigationItem setLeftBarButtonItem:nil animated:YES]; self.masterPopoverController = nil; } @end ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/MasterViewController.h ================================================ // // MasterViewController.h // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import @class DetailViewController; @interface MasterViewController : UITableViewController @property (strong, nonatomic) DetailViewController *detailViewController; @end ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/MasterViewController.m ================================================ // // MasterViewController.m // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import "MasterViewController.h" #import "DetailViewController.h" @implementation MasterViewController @synthesize detailViewController = _detailViewController; - (void)awakeFromNib { self.clearsSelectionOnViewWillAppear = NO; self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0); [super awakeFromNib]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionMiddle]; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; } /* // Override to support conditional editing of the table view. - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { // Return NO if you do not want the specified item to be editable. return YES; } */ /* // Override to support editing the table view. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { // Delete the row from the data source. [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; } else if (editingStyle == UITableViewCellEditingStyleInsert) { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. } } */ /* // Override to support rearranging the table view. - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { } */ /* // Override to support conditional rearranging of the table view. - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { // Return NO if you do not want the item to be re-orderable. return YES; } */ @end ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/en.lproj/MainStoryboard.storyboard ================================================ ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool/main.m ================================================ // // main.m // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import #import "AppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } } ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool/AFCacheTestTool.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 058339DF150CBE63005A6D55 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 058339DE150CBE63005A6D55 /* UIKit.framework */; }; 058339E1150CBE63005A6D55 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 058339E0150CBE63005A6D55 /* Foundation.framework */; }; 058339E3150CBE63005A6D55 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 058339E2150CBE63005A6D55 /* CoreGraphics.framework */; }; 058339E9150CBE63005A6D55 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 058339E7150CBE63005A6D55 /* InfoPlist.strings */; }; 058339EB150CBE63005A6D55 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 058339EA150CBE63005A6D55 /* main.m */; }; 058339EF150CBE63005A6D55 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 058339EE150CBE63005A6D55 /* AppDelegate.m */; }; 058339F2150CBE63005A6D55 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 058339F0150CBE63005A6D55 /* MainStoryboard.storyboard */; }; 058339F5150CBE63005A6D55 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 058339F4150CBE63005A6D55 /* MasterViewController.m */; }; 058339F8150CBE63005A6D55 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 058339F7150CBE63005A6D55 /* DetailViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 058339DA150CBE63005A6D55 /* AFCacheTestTool.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AFCacheTestTool.app; sourceTree = BUILT_PRODUCTS_DIR; }; 058339DE150CBE63005A6D55 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 058339E0150CBE63005A6D55 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 058339E2150CBE63005A6D55 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 058339E6150CBE63005A6D55 /* AFCacheTestTool-Info.plist */ = {isa = PBXFileReference; path = "AFCacheTestTool-Info.plist"; sourceTree = ""; }; 058339E8150CBE63005A6D55 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 058339EA150CBE63005A6D55 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 058339EC150CBE63005A6D55 /* AFCacheTestTool-Prefix.pch */ = {isa = PBXFileReference; path = "AFCacheTestTool-Prefix.pch"; sourceTree = ""; }; 058339ED150CBE63005A6D55 /* AppDelegate.h */ = {isa = PBXFileReference; path = AppDelegate.h; sourceTree = ""; }; 058339EE150CBE63005A6D55 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 058339F1150CBE63005A6D55 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; 058339F3150CBE63005A6D55 /* MasterViewController.h */ = {isa = PBXFileReference; path = MasterViewController.h; sourceTree = ""; }; 058339F4150CBE63005A6D55 /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; 058339F6150CBE63005A6D55 /* DetailViewController.h */ = {isa = PBXFileReference; path = DetailViewController.h; sourceTree = ""; }; 058339F7150CBE63005A6D55 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 058339D7150CBE63005A6D55 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 058339DF150CBE63005A6D55 /* UIKit.framework in Frameworks */, 058339E1150CBE63005A6D55 /* Foundation.framework in Frameworks */, 058339E3150CBE63005A6D55 /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 058339CF150CBE63005A6D55 = { isa = PBXGroup; children = ( 058339E4150CBE63005A6D55 /* AFCacheTestTool */, 058339DD150CBE63005A6D55 /* Frameworks */, 058339DB150CBE63005A6D55 /* Products */, ); sourceTree = ""; }; 058339DB150CBE63005A6D55 /* Products */ = { isa = PBXGroup; children = ( 058339DA150CBE63005A6D55 /* AFCacheTestTool.app */, ); name = Products; sourceTree = ""; }; 058339DD150CBE63005A6D55 /* Frameworks */ = { isa = PBXGroup; children = ( 058339DE150CBE63005A6D55 /* UIKit.framework */, 058339E0150CBE63005A6D55 /* Foundation.framework */, 058339E2150CBE63005A6D55 /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; 058339E4150CBE63005A6D55 /* AFCacheTestTool */ = { isa = PBXGroup; children = ( 058339ED150CBE63005A6D55 /* AppDelegate.h */, 058339EE150CBE63005A6D55 /* AppDelegate.m */, 058339F0150CBE63005A6D55 /* MainStoryboard.storyboard */, 058339F3150CBE63005A6D55 /* MasterViewController.h */, 058339F4150CBE63005A6D55 /* MasterViewController.m */, 058339F6150CBE63005A6D55 /* DetailViewController.h */, 058339F7150CBE63005A6D55 /* DetailViewController.m */, 058339E5150CBE63005A6D55 /* Supporting Files */, ); path = AFCacheTestTool; sourceTree = ""; }; 058339E5150CBE63005A6D55 /* Supporting Files */ = { isa = PBXGroup; children = ( 058339E6150CBE63005A6D55 /* AFCacheTestTool-Info.plist */, 058339E7150CBE63005A6D55 /* InfoPlist.strings */, 058339EA150CBE63005A6D55 /* main.m */, 058339EC150CBE63005A6D55 /* AFCacheTestTool-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 058339D9150CBE63005A6D55 /* AFCacheTestTool */ = { isa = PBXNativeTarget; buildConfigurationList = 058339FB150CBE63005A6D55 /* Build configuration list for PBXNativeTarget "AFCacheTestTool" */; buildPhases = ( 058339D6150CBE63005A6D55 /* Sources */, 058339D7150CBE63005A6D55 /* Frameworks */, 058339D8150CBE63005A6D55 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = AFCacheTestTool; productName = AFCacheTestTool; productReference = 058339DA150CBE63005A6D55 /* AFCacheTestTool.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 058339D1150CBE63005A6D55 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0420; ORGANIZATIONNAME = "artifacts Software GmbH & Co. KG"; }; buildConfigurationList = 058339D4150CBE63005A6D55 /* Build configuration list for PBXProject "AFCacheTestTool" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 058339CF150CBE63005A6D55; productRefGroup = 058339DB150CBE63005A6D55 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 058339D9150CBE63005A6D55 /* AFCacheTestTool */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 058339D8150CBE63005A6D55 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 058339E9150CBE63005A6D55 /* InfoPlist.strings in Resources */, 058339F2150CBE63005A6D55 /* MainStoryboard.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 058339D6150CBE63005A6D55 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 058339EB150CBE63005A6D55 /* main.m in Sources */, 058339EF150CBE63005A6D55 /* AppDelegate.m in Sources */, 058339F5150CBE63005A6D55 /* MasterViewController.m in Sources */, 058339F8150CBE63005A6D55 /* DetailViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 058339E7150CBE63005A6D55 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 058339E8150CBE63005A6D55 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; 058339F0150CBE63005A6D55 /* MainStoryboard.storyboard */ = { isa = PBXVariantGroup; children = ( 058339F1150CBE63005A6D55 /* en */, ); name = MainStoryboard.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 058339F9150CBE63005A6D55 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 2; }; name = Debug; }; 058339FA150CBE63005A6D55 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 2; VALIDATE_PRODUCT = YES; }; name = Release; }; 058339FC150CBE63005A6D55 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheTestTool/AFCacheTestTool-Prefix.pch"; INFOPLIST_FILE = "AFCacheTestTool/AFCacheTestTool-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Debug; }; 058339FD150CBE63005A6D55 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheTestTool/AFCacheTestTool-Prefix.pch"; INFOPLIST_FILE = "AFCacheTestTool/AFCacheTestTool-Info.plist"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 058339D4150CBE63005A6D55 /* Build configuration list for PBXProject "AFCacheTestTool" */ = { isa = XCConfigurationList; buildConfigurations = ( 058339F9150CBE63005A6D55 /* Debug */, 058339FA150CBE63005A6D55 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 058339FB150CBE63005A6D55 /* Build configuration list for PBXNativeTarget "AFCacheTestTool" */ = { isa = XCConfigurationList; buildConfigurations = ( 058339FC150CBE63005A6D55 /* Debug */, 058339FD150CBE63005A6D55 /* Release */, ); defaultConfigurationIsVisible = 0; }; /* End XCConfigurationList section */ }; rootObject = 058339D1150CBE63005A6D55 /* Project object */; } ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleDisplayName ${PRODUCT_NAME} CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles CFBundleIdentifier de.artifacts.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 LSRequiresIPhoneOS UIMainStoryboardFile MainStoryboard UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestTool-Prefix.pch ================================================ // // Prefix header for all source files of the 'AFCacheTestTool' target in the 'AFCacheTestTool' project // #import #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import #import #endif ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestToolAppDelegate.h ================================================ // // AppDelegate.h // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import @interface AFCacheTestToolAppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; - (void)reinitIncomingResponses; @end ================================================ FILE: AFCacheTestTool-iOS/AFCacheTestToolAppDelegate.m ================================================ // // AppDelegate.m // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import "AFCacheTestToolAppDelegate.h" #import "AFCache.h" #import "AFDebugHTTPURLProtocol.h" #import "MasterViewController.h" @implementation AFCacheTestToolAppDelegate @synthesize window = _window; - (void)reinitIncomingResponses { UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; UINavigationController *masterNavigationController = [splitViewController.viewControllers objectAtIndex:0]; MasterViewController *masterViewController = (MasterViewController*)masterNavigationController.topViewController; masterViewController.incomingResponses = [[NSMutableArray alloc] init]; [masterViewController.tableView reloadData]; [AFDebugHTTPURLProtocol setDebugDelegate:masterViewController]; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [NSURLProtocol registerClass:[AFDebugHTTPURLProtocol class]]; // Override point for customization after application launch. [self reinitIncomingResponses]; UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; splitViewController.delegate = (id)navigationController.topViewController; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ } - (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. */ } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. */ } - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ } - (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. */ } @end ================================================ FILE: AFCacheTestTool-iOS/AFCacheableItemCell.h ================================================ // // AFCachableItemCell.h // AFCacheTestTool // // Created by Michael Markowski on 12.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import @interface AFCacheableItemCell : UITableViewCell @property (strong, nonatomic) IBOutlet UILabel *keyLabel; @property (strong, nonatomic) IBOutlet UILabel *valueLabel; @end ================================================ FILE: AFCacheTestTool-iOS/AFCacheableItemCell.m ================================================ // // AFCachableItemCell.m // AFCacheTestTool // // Created by Michael Markowski on 12.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import "AFCacheableItemCell.h" @implementation AFCacheableItemCell @synthesize keyLabel, valueLabel; - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // Initialization code } return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end ================================================ FILE: AFCacheTestTool-iOS/AFDebugHTTPURLProtocol.h ================================================ // // AFDebugHTTPURLProtocol.h // AFCacheTestTool // // Created by Michael Markowski on 12.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import "AFHTTPURLProtocol.h" #import "AFCache.h" static id staticDebugDelegate; @interface AFDebugHTTPURLProtocol : AFHTTPURLProtocol + (void)setDebugDelegate:(id)aDelegate; @end ================================================ FILE: AFCacheTestTool-iOS/AFDebugHTTPURLProtocol.m ================================================ // // AFDebugHTTPURLProtocol.m // AFCacheTestTool // // Created by Michael Markowski on 12.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import "AFDebugHTTPURLProtocol.h" @implementation AFDebugHTTPURLProtocol + (void)setDebugDelegate:(id)aDelegate { staticDebugDelegate = aDelegate; } - (void) connectionDidFail: (AFCacheableItem *) cacheableItem { [staticDebugDelegate connectionDidFail: cacheableItem]; [super connectionDidFail:cacheableItem]; } - (void) connectionDidFinish: (AFCacheableItem *) cacheableItem { [staticDebugDelegate connectionDidFinish: cacheableItem]; [super connectionDidFinish:cacheableItem]; } @end ================================================ FILE: AFCacheTestTool-iOS/DetailViewController.h ================================================ // // DetailViewController.h // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import @interface DetailViewController : UIViewController @property (strong, nonatomic) id detailItem; @property (strong, nonatomic) IBOutlet UILabel *detailDescriptionLabel; @property (strong, nonatomic) IBOutlet UIWebView *webView; @property (strong, nonatomic) IBOutlet UITableView *tableView; @property (strong, nonatomic) IBOutlet UILabel *cacheHitLabel; @property (strong, nonatomic) IBOutlet UILabel *imsLabel; - (IBAction)reloadAction:(id)sender; - (IBAction)clearCacheAction:(id)sender; - (IBAction)setOfflineAction:(id)sender; - (IBAction)requestCurrentCacheableItem:(id)sender; - (IBAction)persistCacheAction:(id)sender; @end ================================================ FILE: AFCacheTestTool-iOS/DetailViewController.m ================================================ // // DetailViewController.m // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import "DetailViewController.h" #import "AFCache.h" #import "AFCacheableItemCell.h" #import "AFCacheTestToolAppDelegate.h" #import "MasterViewController.h" enum TableSections { TableSectionCacheableItem = 0, TableSectionCacheableItemInfo = 1, TableSectionRequest = 2, TableSectionResponse = 3, }; enum TableRowsCacheableItem { TableRowUrl, TableRowPersistable, TableRowIgnoreErrors, TableRowError, TableRowValidUntil, TableRowCacheStatus, TableRowUserData, TableRowIsPackageArchive, TableRowCurrentContentLength, TableRowUsername, TableRowPassword, TableRowIsRevalidating, TableRowIMSRequest, }; NSUInteger TableRowsCacheableItemNumberOfRows = 13; enum TableRowsCacheableItemInfo { InfoRequestTimestamp, InfoResponseTimestamp, InfoServerDate, InfoLastModified, InfoAge, InfoMaxAge, InfoExpireDate, InfoETag, InfoStatusCode, InfoContentLength, InfoMimeType, InfoResponseURL, InfoRequest, InfoResponse }; NSUInteger TableRowsCacheableItemInfoNumberOfRows = 14; NSUInteger TableRowsRequestNumberOfRows = 1; NSUInteger TableRowsResponseNumberOfRows = 1; @interface DetailViewController () @property (strong, nonatomic) UIPopoverController *masterPopoverController; - (void)configureView; @end @implementation DetailViewController @synthesize detailItem = _detailItem; @synthesize detailDescriptionLabel = _detailDescriptionLabel; @synthesize masterPopoverController = _masterPopoverController; @synthesize webView = _webView; @synthesize tableView = _tableView; @synthesize cacheHitLabel = _cacheHitLabel; @synthesize imsLabel = _imsLabel; #pragma mark - Actions - (IBAction)reloadAction:(id)sender { [((AFCacheTestToolAppDelegate*)[UIApplication sharedApplication].delegate) reinitIncomingResponses]; //NSURL *url = [NSURL URLWithString:@"http://www.artifacts.de/302a.html"]; // this won't work in flight mode, don't know why yet NSURL *url = [NSURL URLWithString:@"http://www.artifacts.de/index_en.html"]; // this one works (no redirect) NSURLRequest *request = [NSURLRequest requestWithURL:url]; [_webView loadRequest:request]; } #pragma mark - WebView delegate methods - (void)webViewDidFinishLoad:(UIWebView *)webView { [self configureView]; } #pragma mark - Managing the detail item - (void)setDetailItem:(id)newDetailItem { if (_detailItem != newDetailItem) { _detailItem = newDetailItem; // Update the view. [self configureView]; } if (self.masterPopoverController != nil) { [self.masterPopoverController dismissPopoverAnimated:YES]; } } - (void)configureView { // Update the user interface for the detail item. if (![_detailItem isKindOfClass:[AFCacheableItem class]]) return; AFCacheableItem *item = _detailItem; if (self.detailItem) { self.imsLabel.text = (item.IMSRequest != nil)?@"YES":@"NO"; self.cacheHitLabel.text = (item.servedFromCache==YES)?@"YES":@"NO"; [self.tableView reloadData]; } } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self configureView]; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; } #pragma mark - Split view - (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController { barButtonItem.title = NSLocalizedString(@"Master", @"Master"); [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES]; self.masterPopoverController = popoverController; } - (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem { // Called when the view is shown again in the split view, invalidating the button and popover controller. [self.navigationItem setLeftBarButtonItem:nil animated:YES]; self.masterPopoverController = nil; } #pragma mark - Table View - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { AFCacheableItem *cacheableItem = self.detailItem; switch (section) { case TableSectionCacheableItem: return TableRowsCacheableItemNumberOfRows; break; case TableSectionCacheableItemInfo: return TableRowsCacheableItemInfoNumberOfRows; break; case TableSectionRequest: return [[[cacheableItem.info.request allHTTPHeaderFields] allValues] count]; break; case TableSectionResponse: if ([cacheableItem.info.response isKindOfClass:[NSHTTPURLResponse class]]) { return [[[((NSHTTPURLResponse*)cacheableItem.info.response) allHeaderFields] allValues] count]; } else { return 0; } break; } return 0; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 4; } - (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *reuseIdentifier = @"AFCacheableItemCell"; AFCacheableItemCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; AFCacheableItem *cacheableItem = self.detailItem; if (cell == nil) { cell = [[AFCacheableItemCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; } cell.keyLabel.text = @""; cell.valueLabel.text = @""; switch (indexPath.section) { case TableSectionCacheableItem: switch (indexPath.row) { case TableRowUrl: cell.keyLabel.text = @"URL"; cell.valueLabel.text = [cacheableItem.url absoluteString]; break; case TableRowPersistable: cell.keyLabel.text = @"Persistable"; cell.valueLabel.text = cacheableItem.persistable?@"YES":@"NO"; break; case TableRowIgnoreErrors: cell.keyLabel.text = @"IgnoreErrors"; cell.valueLabel.text = cacheableItem.ignoreErrors?@"YES":@"NO"; break; case TableRowError: cell.keyLabel.text = @"Error"; cell.valueLabel.text = [cacheableItem.error description]; break; case TableRowValidUntil: cell.keyLabel.text = @"ValidUntil"; cell.valueLabel.text = [cacheableItem.validUntil description]; break; case TableRowCacheStatus: cell.keyLabel.text = @"Cache Status"; cell.valueLabel.text = [NSString stringWithFormat:@"%d", cacheableItem.cacheStatus]; break; case TableRowUserData: cell.keyLabel.text = @"UserData"; cell.valueLabel.text = cacheableItem.userData; break; case TableRowIsPackageArchive: cell.keyLabel.text = @"Is Package Archive"; cell.valueLabel.text = cacheableItem.isPackageArchive?@"YES":@"NO"; break; case TableRowCurrentContentLength: cell.keyLabel.text = @"CurentContentLength"; cell.valueLabel.text = [NSString stringWithFormat:@"%d", cacheableItem.currentContentLength]; break; case TableRowUsername: cell.keyLabel.text = @"Username"; cell.valueLabel.text = cacheableItem.username; break; case TableRowPassword: cell.keyLabel.text = @"Password"; cell.valueLabel.text = cacheableItem.password; break; case TableRowIsRevalidating: cell.keyLabel.text = @"Is Revalidating"; cell.valueLabel.text = cacheableItem.isRevalidating?@"YES":@"NO"; break; case TableRowIMSRequest: cell.keyLabel.text = @"If-Modified-Since Request"; cell.valueLabel.text = [cacheableItem.IMSRequest description]; break; } break; case TableSectionCacheableItemInfo: switch (indexPath.row) { case InfoRequestTimestamp: cell.keyLabel.text = @"Request Timestamp"; cell.valueLabel.text = [NSString stringWithFormat:@"%f", cacheableItem.info.requestTimestamp]; break; case InfoResponseTimestamp: cell.keyLabel.text = @"Response Timestamp"; cell.valueLabel.text = [NSString stringWithFormat:@"%f", cacheableItem.info.responseTimestamp]; break; case InfoServerDate: cell.keyLabel.text = @"Server Date"; cell.valueLabel.text = [cacheableItem.info.serverDate description]; break; case InfoLastModified: cell.keyLabel.text = @"Last Modified"; cell.valueLabel.text = [cacheableItem.info.lastModified description]; break; case InfoAge: cell.keyLabel.text = @"Age"; cell.valueLabel.text = [NSString stringWithFormat:@"%d", cacheableItem.info.age]; break; case InfoMaxAge: cell.keyLabel.text = @"Max Age"; cell.valueLabel.text = [NSString stringWithFormat:@"%d", cacheableItem.info.maxAge]; break; case InfoExpireDate: cell.keyLabel.text = @"Expire Date"; cell.valueLabel.text = [cacheableItem.info.expireDate description]; break; case InfoETag: cell.keyLabel.text = @"ETag"; cell.valueLabel.text = cacheableItem.info.eTag; break; case InfoStatusCode: cell.keyLabel.text = @"Status Code"; cell.valueLabel.text = [NSString stringWithFormat:@"%d", cacheableItem.info.statusCode]; break; case InfoContentLength: cell.keyLabel.text = @"Content Length"; cell.valueLabel.text = [NSString stringWithFormat:@"%d", cacheableItem.info.contentLength]; break; case InfoMimeType: cell.keyLabel.text = @"MimeType"; cell.valueLabel.text = cacheableItem.info.mimeType; break; case InfoResponseURL: cell.keyLabel.text = @"ResponseURL"; cell.valueLabel.text = [cacheableItem.info.responseURL absoluteString]; break; } break; case TableSectionRequest: cell.keyLabel.text = [[[cacheableItem.info.request allHTTPHeaderFields] allKeys] objectAtIndex:indexPath.row]; cell.valueLabel.text = [[cacheableItem.info.request allHTTPHeaderFields] valueForKey:cell.keyLabel.text]; break; case TableSectionResponse: if ([cacheableItem.info.response isKindOfClass:[NSHTTPURLResponse class]]) { cell.keyLabel.text = [[[((NSHTTPURLResponse*)cacheableItem.info.response) allHeaderFields] allKeys] objectAtIndex:indexPath.row]; cell.valueLabel.text = [[((NSHTTPURLResponse*)cacheableItem.info.response) allHeaderFields] valueForKey:cell.keyLabel.text]; } break; } return cell; } - (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { switch (section) { case TableSectionCacheableItem: return @"Cachable Item"; break; case TableSectionCacheableItemInfo: return @"Cachable Item Info"; break; case TableSectionRequest: return @"Request"; break; case TableSectionResponse: return @"Response"; break; } return nil; } - (IBAction)persistCacheAction:(id)sender { [[AFCache sharedInstance] archive]; } - (IBAction)clearCacheAction:(id)sender { [[AFCache sharedInstance] invalidateAll]; [((AFCacheTestToolAppDelegate*)[UIApplication sharedApplication].delegate) reinitIncomingResponses]; } - (IBAction)setOfflineAction:(id)sender { UISwitch *theSwitch = sender; BOOL offline = theSwitch.on; [[AFCache sharedInstance] setOffline:offline]; } - (IBAction)requestCurrentCacheableItem:(id)sender { AFCacheableItem *cacheableItem = self.detailItem; [self.webView loadRequest:[NSURLRequest requestWithURL: cacheableItem.url]]; } @end ================================================ FILE: AFCacheTestTool-iOS/MasterViewController.h ================================================ // // MasterViewController.h // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import #import "AFCache.h" @class DetailViewController; @interface MasterViewController : UIViewController @property (strong, nonatomic) DetailViewController *detailViewController; @property (strong, nonatomic) IBOutlet UITableView *tableView; @property (strong, nonatomic) IBOutlet UISegmentedControl *displayMode; @property (strong, nonatomic) NSMutableArray *incomingResponses; @property (nonatomic, retain) NSString *path; - (IBAction)changeDisplayModeAction:(id)sender; @end ================================================ FILE: AFCacheTestTool-iOS/MasterViewController.m ================================================ // // MasterViewController.m // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import "MasterViewController.h" #import "DetailViewController.h" enum TableRows { TableRowShowURLProtocolTest = 0, TableRowShowCacheBrowser = 1, }; enum DisplayModes { DisplayModeIcomingResponses = 0, DisplayModeCacheBrowser = 1, }; @implementation MasterViewController @synthesize detailViewController = _detailViewController; @synthesize tableView = _tableView; @synthesize displayMode = _displayMode; @synthesize incomingResponses = _incomingResponses; @synthesize path = _path; - (void)awakeFromNib { //self.clearsSelectionOnViewWillAppear = NO; self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0); [super awakeFromNib]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; self.path = [[AFCache sharedInstance] dataPath]; // Do any additional setup after loading the view, typically from a nib. self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; // [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionMiddle]; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { switch (self.displayMode.selectedSegmentIndex) { case DisplayModeCacheBrowser: { NSError *error = nil; NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:self.path error:&error]; NSString *filename = [files objectAtIndex:indexPath.row]; NSString *nextPath = [self.path stringByAppendingPathComponent:filename]; BOOL isDir = NO; [[NSFileManager defaultManager] fileExistsAtPath:nextPath isDirectory: &isDir]; if (isDir == YES) { MasterViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"MasterViewController"]; [vc view]; [vc setPath:nextPath]; [vc.displayMode setSelectedSegmentIndex:DisplayModeCacheBrowser]; [vc.displayMode setHidden:YES]; [self.navigationController pushViewController:vc animated:YES]; } else { DetailViewController *detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; NSString *urlString = [nextPath stringByReplacingOccurrencesOfString:[[AFCache sharedInstance] dataPath] withString:@"http:/"]; NSURL *url = [NSURL URLWithString:urlString]; AFCacheableItem *cacheableItem = [[AFCache sharedInstance] cacheableItemFromCacheStore:url]; if (cacheableItem) { [detailViewController setDetailItem:cacheableItem]; } } break; } case DisplayModeIcomingResponses: { DetailViewController *detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController]; AFCacheableItem *item = [self.incomingResponses objectAtIndex:indexPath.row]; [detailViewController setDetailItem:item]; break; } } } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { switch (self.displayMode.selectedSegmentIndex) { case DisplayModeCacheBrowser: { NSError *error = nil; NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:self.path error:&error]; return [files count]; } break; case DisplayModeIcomingResponses: return [self.incomingResponses count]; break; } return 0; } - (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *reuseIdentifier = @"ResponseCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; } switch (self.displayMode.selectedSegmentIndex) { case DisplayModeCacheBrowser: { NSError *error = nil; NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:self.path error:&error]; NSString *filename = [files objectAtIndex:indexPath.row]; cell.textLabel.text = filename; break; } case DisplayModeIcomingResponses: { AFCacheableItem *item = [self.incomingResponses objectAtIndex:indexPath.row]; cell.textLabel.text = [item.url lastPathComponent]; break; } } return cell; } - (void)connectionDidFail:(AFCacheableItem *)cacheableItem { } - (void)connectionDidFinish:(AFCacheableItem *)cacheableItem { [self.incomingResponses addObject:cacheableItem]; [self.tableView reloadData]; } - (IBAction)changeDisplayModeAction:(id)sender { [self.tableView reloadData]; } @end ================================================ FILE: AFCacheTestTool-iOS/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: AFCacheTestTool-iOS/en.lproj/MainStoryboard.storyboard ================================================ ================================================ FILE: AFCacheTestTool-iOS/main.m ================================================ // // main.m // AFCacheTestTool // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 artifacts Software GmbH & Co. KG. All rights reserved. // #import #import "AFCacheTestToolAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AFCacheTestToolAppDelegate class])); } } ================================================ FILE: AFCacheTestTool.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 054296C6150E17F60000A771 /* AFCacheableItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 054296C5150E17F60000A771 /* AFCacheableItemCell.m */; }; 054296C9150E4B080000A771 /* AFDebugHTTPURLProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 054296C8150E4B080000A771 /* AFDebugHTTPURLProtocol.m */; }; 058339DF150CBE63005A6D55 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 058339DE150CBE63005A6D55 /* UIKit.framework */; }; 058339E1150CBE63005A6D55 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 058339E0150CBE63005A6D55 /* Foundation.framework */; }; 058339E3150CBE63005A6D55 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 058339E2150CBE63005A6D55 /* CoreGraphics.framework */; }; 058339E9150CBE63005A6D55 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 058339E7150CBE63005A6D55 /* InfoPlist.strings */; }; 058339EB150CBE63005A6D55 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 058339EA150CBE63005A6D55 /* main.m */; }; 058339EF150CBE63005A6D55 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 058339EE150CBE63005A6D55 /* AppDelegate.m */; }; 058339F2150CBE63005A6D55 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 058339F0150CBE63005A6D55 /* MainStoryboard.storyboard */; }; 058339F5150CBE63005A6D55 /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 058339F4150CBE63005A6D55 /* MasterViewController.m */; }; 058339F8150CBE63005A6D55 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 058339F7150CBE63005A6D55 /* DetailViewController.m */; }; 05833A27150CC06C005A6D55 /* libAFCache-iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05833A20150CC05C005A6D55 /* libAFCache-iOS.a */; }; 05833A29150CC088005A6D55 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05833A28150CC088005A6D55 /* SystemConfiguration.framework */; }; 05833A2B150CC249005A6D55 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 05833A2A150CC249005A6D55 /* libz.dylib */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 05833A1F150CC05C005A6D55 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 05833A16150CC05B005A6D55 /* AFCache-iOS.xcodeproj */; proxyType = 2; remoteGlobalIDString = 051B386D1328AACA0057F2F5; remoteInfo = "AFCache-iOS"; }; 05833A21150CC05C005A6D55 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 05833A16150CC05B005A6D55 /* AFCache-iOS.xcodeproj */; proxyType = 2; remoteGlobalIDString = 051B387A1328AACA0057F2F5; remoteInfo = "AFCache-iOSTests"; }; 05833A23150CC05C005A6D55 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 05833A16150CC05B005A6D55 /* AFCache-iOS.xcodeproj */; proxyType = 2; remoteGlobalIDString = 0566AE001332D6B500583E6A; remoteInfo = AFCacheDemo; }; 05833A25150CC068005A6D55 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 05833A16150CC05B005A6D55 /* AFCache-iOS.xcodeproj */; proxyType = 1; remoteGlobalIDString = 051B386C1328AACA0057F2F5; remoteInfo = "AFCache-iOS"; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 054296C4150E17F60000A771 /* AFCacheableItemCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFCacheableItemCell.h; sourceTree = ""; }; 054296C5150E17F60000A771 /* AFCacheableItemCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFCacheableItemCell.m; sourceTree = ""; }; 054296C7150E4B080000A771 /* AFDebugHTTPURLProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFDebugHTTPURLProtocol.h; sourceTree = ""; }; 054296C8150E4B080000A771 /* AFDebugHTTPURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFDebugHTTPURLProtocol.m; sourceTree = ""; }; 058339DA150CBE63005A6D55 /* AFCacheTestTool.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AFCacheTestTool.app; sourceTree = BUILT_PRODUCTS_DIR; }; 058339DE150CBE63005A6D55 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 058339E0150CBE63005A6D55 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 058339E2150CBE63005A6D55 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 058339E6150CBE63005A6D55 /* AFCacheTestTool-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "AFCacheTestTool-Info.plist"; sourceTree = ""; }; 058339E8150CBE63005A6D55 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 058339EA150CBE63005A6D55 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 058339EC150CBE63005A6D55 /* AFCacheTestTool-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AFCacheTestTool-Prefix.pch"; sourceTree = ""; }; 058339ED150CBE63005A6D55 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 058339EE150CBE63005A6D55 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 058339F1150CBE63005A6D55 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = ""; }; 058339F3150CBE63005A6D55 /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; 058339F4150CBE63005A6D55 /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; 058339F6150CBE63005A6D55 /* DetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; 058339F7150CBE63005A6D55 /* DetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; 05833A16150CC05B005A6D55 /* AFCache-iOS.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = "AFCache-iOS.xcodeproj"; sourceTree = ""; }; 05833A28150CC088005A6D55 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 05833A2A150CC249005A6D55 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 058339D7150CBE63005A6D55 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 05833A2B150CC249005A6D55 /* libz.dylib in Frameworks */, 05833A29150CC088005A6D55 /* SystemConfiguration.framework in Frameworks */, 058339DF150CBE63005A6D55 /* UIKit.framework in Frameworks */, 05833A27150CC06C005A6D55 /* libAFCache-iOS.a in Frameworks */, 058339E1150CBE63005A6D55 /* Foundation.framework in Frameworks */, 058339E3150CBE63005A6D55 /* CoreGraphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 058339CF150CBE63005A6D55 = { isa = PBXGroup; children = ( 05833A2A150CC249005A6D55 /* libz.dylib */, 05833A28150CC088005A6D55 /* SystemConfiguration.framework */, 05833A16150CC05B005A6D55 /* AFCache-iOS.xcodeproj */, 058339E4150CBE63005A6D55 /* AFCacheTestTool */, 058339DD150CBE63005A6D55 /* Frameworks */, 058339DB150CBE63005A6D55 /* Products */, ); sourceTree = ""; }; 058339DB150CBE63005A6D55 /* Products */ = { isa = PBXGroup; children = ( 058339DA150CBE63005A6D55 /* AFCacheTestTool.app */, ); name = Products; sourceTree = ""; }; 058339DD150CBE63005A6D55 /* Frameworks */ = { isa = PBXGroup; children = ( 058339DE150CBE63005A6D55 /* UIKit.framework */, 058339E0150CBE63005A6D55 /* Foundation.framework */, 058339E2150CBE63005A6D55 /* CoreGraphics.framework */, ); name = Frameworks; sourceTree = ""; }; 058339E4150CBE63005A6D55 /* AFCacheTestTool */ = { isa = PBXGroup; children = ( 058339ED150CBE63005A6D55 /* AppDelegate.h */, 058339EE150CBE63005A6D55 /* AppDelegate.m */, 058339F0150CBE63005A6D55 /* MainStoryboard.storyboard */, 058339F3150CBE63005A6D55 /* MasterViewController.h */, 058339F4150CBE63005A6D55 /* MasterViewController.m */, 058339F6150CBE63005A6D55 /* DetailViewController.h */, 058339F7150CBE63005A6D55 /* DetailViewController.m */, 058339E5150CBE63005A6D55 /* Supporting Files */, 054296C4150E17F60000A771 /* AFCacheableItemCell.h */, 054296C5150E17F60000A771 /* AFCacheableItemCell.m */, 054296C7150E4B080000A771 /* AFDebugHTTPURLProtocol.h */, 054296C8150E4B080000A771 /* AFDebugHTTPURLProtocol.m */, ); path = AFCacheTestTool; sourceTree = ""; }; 058339E5150CBE63005A6D55 /* Supporting Files */ = { isa = PBXGroup; children = ( 058339E6150CBE63005A6D55 /* AFCacheTestTool-Info.plist */, 058339E7150CBE63005A6D55 /* InfoPlist.strings */, 058339EA150CBE63005A6D55 /* main.m */, 058339EC150CBE63005A6D55 /* AFCacheTestTool-Prefix.pch */, ); name = "Supporting Files"; sourceTree = ""; }; 05833A17150CC05B005A6D55 /* Products */ = { isa = PBXGroup; children = ( 05833A20150CC05C005A6D55 /* libAFCache-iOS.a */, 05833A22150CC05C005A6D55 /* AFCache-iOSTests.octest */, 05833A24150CC05C005A6D55 /* AFCacheDemo.app */, ); name = Products; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 058339D9150CBE63005A6D55 /* AFCacheTestTool */ = { isa = PBXNativeTarget; buildConfigurationList = 058339FB150CBE63005A6D55 /* Build configuration list for PBXNativeTarget "AFCacheTestTool" */; buildPhases = ( 058339D6150CBE63005A6D55 /* Sources */, 058339D7150CBE63005A6D55 /* Frameworks */, 058339D8150CBE63005A6D55 /* Resources */, ); buildRules = ( ); dependencies = ( 05833A26150CC068005A6D55 /* PBXTargetDependency */, ); name = AFCacheTestTool; productName = AFCacheTestTool; productReference = 058339DA150CBE63005A6D55 /* AFCacheTestTool.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 058339D1150CBE63005A6D55 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0420; ORGANIZATIONNAME = "artifacts Software GmbH & Co. KG"; }; buildConfigurationList = 058339D4150CBE63005A6D55 /* Build configuration list for PBXProject "AFCacheTestTool" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); mainGroup = 058339CF150CBE63005A6D55; productRefGroup = 058339DB150CBE63005A6D55 /* Products */; projectDirPath = ""; projectReferences = ( { ProductGroup = 05833A17150CC05B005A6D55 /* Products */; ProjectRef = 05833A16150CC05B005A6D55 /* AFCache-iOS.xcodeproj */; }, ); projectRoot = ""; targets = ( 058339D9150CBE63005A6D55 /* AFCacheTestTool */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ 05833A20150CC05C005A6D55 /* libAFCache-iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libAFCache-iOS.a"; remoteRef = 05833A1F150CC05C005A6D55 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; 05833A22150CC05C005A6D55 /* AFCache-iOSTests.octest */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; path = "AFCache-iOSTests.octest"; remoteRef = 05833A21150CC05C005A6D55 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; 05833A24150CC05C005A6D55 /* AFCacheDemo.app */ = { isa = PBXReferenceProxy; fileType = wrapper.application; path = AFCacheDemo.app; remoteRef = 05833A23150CC05C005A6D55 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ 058339D8150CBE63005A6D55 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 058339E9150CBE63005A6D55 /* InfoPlist.strings in Resources */, 058339F2150CBE63005A6D55 /* MainStoryboard.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 058339D6150CBE63005A6D55 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 058339EB150CBE63005A6D55 /* main.m in Sources */, 058339EF150CBE63005A6D55 /* AppDelegate.m in Sources */, 058339F5150CBE63005A6D55 /* MasterViewController.m in Sources */, 058339F8150CBE63005A6D55 /* DetailViewController.m in Sources */, 054296C6150E17F60000A771 /* AFCacheableItemCell.m in Sources */, 054296C9150E4B080000A771 /* AFDebugHTTPURLProtocol.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 05833A26150CC068005A6D55 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = "AFCache-iOS"; targetProxy = 05833A25150CC068005A6D55 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 058339E7150CBE63005A6D55 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 058339E8150CBE63005A6D55 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; 058339F0150CBE63005A6D55 /* MainStoryboard.storyboard */ = { isa = PBXVariantGroup; children = ( 058339F1150CBE63005A6D55 /* en */, ); name = MainStoryboard.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 058339F9150CBE63005A6D55 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 2; }; name = Debug; }; 058339FA150CBE63005A6D55 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = 2; VALIDATE_PRODUCT = YES; }; name = Release; }; 058339FC150CBE63005A6D55 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheTestTool/AFCacheTestTool-Prefix.pch"; INFOPLIST_FILE = "AFCacheTestTool/AFCacheTestTool-Info.plist"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "../AFCache/**"; WRAPPER_EXTENSION = app; }; name = Debug; }; 058339FD150CBE63005A6D55 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AFCacheTestTool/AFCacheTestTool-Prefix.pch"; INFOPLIST_FILE = "AFCacheTestTool/AFCacheTestTool-Info.plist"; OTHER_LDFLAGS = ( "-all_load", "-ObjC", ); PRODUCT_NAME = "$(TARGET_NAME)"; USER_HEADER_SEARCH_PATHS = "../AFCache/**"; WRAPPER_EXTENSION = app; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 058339D4150CBE63005A6D55 /* Build configuration list for PBXProject "AFCacheTestTool" */ = { isa = XCConfigurationList; buildConfigurations = ( 058339F9150CBE63005A6D55 /* Debug */, 058339FA150CBE63005A6D55 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 058339FB150CBE63005A6D55 /* Build configuration list for PBXNativeTarget "AFCacheTestTool" */ = { isa = XCConfigurationList; buildConfigurations = ( 058339FC150CBE63005A6D55 /* Debug */, 058339FD150CBE63005A6D55 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 058339D1150CBE63005A6D55 /* Project object */; } ================================================ FILE: AFCacheTests/AFCacheTests-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier de.artifacts.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: AFCacheTests/AFCacheTests-Prefix.pch ================================================ // // Prefix header for all source files of the 'AFCacheTests' target in the 'AFCacheTests' project // #ifdef __OBJC__ #import #endif ================================================ FILE: AFCacheTests/AFCacheTests.h ================================================ // // AFCacheTests.h // AFCacheTests // // Created by Michael Markowski on 11.03.11. // Copyright 2011 Artifacts - Fine Software Development. All rights reserved. // #import @interface AFCacheTests : SenTestCase { @private } @end ================================================ FILE: AFCacheTests/AFCacheTests.m ================================================ // // AFCacheTests.m // AFCacheTests // // Created by Michael Markowski on 11.03.11. // Copyright 2011 Artifacts - Fine Software Development. All rights reserved. // #import "AFCacheTests.h" #import "AFCache.h" #import "AFCacheableItem.h" @implementation AFCacheTests - (void)setUp { [super setUp]; } - (void)tearDown { // wait until archiving has been finished (default is 5s) [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:8.0]]; [super tearDown]; } - (void)testCacheableItemBlocks_Success { __block BOOL requestHandled = NO; __block BOOL success = NO; [[AFCache sharedInstance] cachedObjectForURL:[NSURL URLWithString:@"http://localhost/~mic/artifacts/img/images/af-base.png"] completionBlock: ^(AFCacheableItem* item) { NSLog(@"completed. item: %@", item); requestHandled = YES; success = YES; } failBlock: ^(AFCacheableItem* item) { NSLog(@"failed. item: %@", item); requestHandled = YES; } progressBlock: ^(AFCacheableItem* item) { NSLog(@"progress. item: %@", item); } options: 0]; while (!requestHandled) { [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; } STAssertTrue(success, @"The request should have failed but did not - so the test fails."); } - (void)ttttestCacheableItemBlocks_Fail { __block BOOL requestHandled = NO; __block BOOL failed = NO; [[AFCache sharedInstance] cachedObjectForURL:[NSURL URLWithString:@"http://localhost/failed"] completionBlock: ^(AFCacheableItem* item) { NSLog(@"completed. item: %@", item); requestHandled = YES; } failBlock: ^(AFCacheableItem* item) { NSLog(@"failed. item: %@", item); requestHandled = YES; failed = YES; } progressBlock: ^(AFCacheableItem* item) { NSLog(@"progress. item: %@", item); } options: 0]; while (!requestHandled) { [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; } STAssertTrue(failed, @"The request should have failed but did not - so the test fails."); } @end ================================================ FILE: AFCacheTests/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: AFCacheTests/iOS/AFCache-iOSTests-Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier ___VARIABLE_bundleIdentifierPrefix:bundleIdentifier___.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: AFCacheTests/iOS/AFCache-iOSTests-Prefix.pch ================================================ // // Prefix header for all source files of the 'AFCache-iOSTests' target in the 'AFCache-iOSTests' project // #ifdef __OBJC__ #import #endif ================================================ FILE: AFCacheTests/iOS/AFCache_iOSTests.h ================================================ // // AFCache_iOSTests.h // AFCache-iOSTests // // Created by Michael Markowski on 10.03.11. // Copyright 2011 Artifacts - Fine Software Development. All rights reserved. // #import @interface AFCache_iOSTests : SenTestCase { @private } @end ================================================ FILE: AFCacheTests/iOS/AFCache_iOSTests.m ================================================ // // AFCache_iOSTests.m // AFCache-iOSTests // // Created by Michael Markowski on 10.03.11. // Copyright 2011 Artifacts - Fine Software Development. All rights reserved. // #import "AFCache_iOSTests.h" #import "AFMediaTypeParser.h" @implementation AFCache_iOSTests - (void)setUp { [super setUp]; // Set-up code here. } - (void)tearDown { // Tear-down code here. [super tearDown]; } - (void) testMIMEParsing { AFMediaTypeParser* parser = [[AFMediaTypeParser alloc] initWithMIMEType:@"text/html"]; STAssertNil([parser textEncoding], @"Text encoding is not nil"); STAssertEqualObjects(parser.contentType, @"text/html", @"content type is nil"); [parser release]; parser = [[AFMediaTypeParser alloc] initWithMIMEType:@"text/html; charset=utf-8"]; STAssertEqualObjects(parser.textEncoding, @"utf-8", @"text encoding is not utf-8"); STAssertEqualObjects(parser.contentType, @"text/html", @"content type is not text/html"); [parser release]; parser = [[AFMediaTypeParser alloc] initWithMIMEType:@"text/html;bla=foo;charset=utf-8;hello=world"]; STAssertEqualObjects(parser.textEncoding, @"utf-8", @"text encoding is not utf-8"); STAssertEqualObjects(parser.contentType, @"text/html", @"content type is not text/html"); [parser release]; } @end ================================================ FILE: AFCacheTests/iOS/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: CHANGES ================================================ Current version is Rev.0.7.1 2011/03/07: (Michael Markowski, m.markowski@artifacts.de) - Requests resulting in a status code >= 400 will now by default call didFailLoading: instead of didFinishLoading: You may change this behaviour by setting [AFCache sharedInstance].failOnStatusCodeAbove400=NO 2011/02/08, v.0.7: (Michael Markowski, m.markowski@artifacts.de) - Moved master to pre0.7, deleted master, moved branch "bip" to master before moving, on branch bip: - Added AFPackageInfo to help the cache remembering about imported resources - Added macro AFLog for logging and removed most of the AFCACHE_LOGGING_ENABLED ifdefs 2011/01/30, v.0.6.8: (Bjoern Kriews, bkr (0x40) jumper.org) - Added option to use (and embed) the EngineRoom framework for logging this is work in progress - see EngineRoom.xcconfig set CURRENT_PROJECT_VERSION in base.xcconfig, use it in Info.plist base.xcconfig included by OSX framework targets AFCache-OSX-release.xcconfig has ONLY_ACTIVE_ARCH (???) 2010/08/12: - Major overhaul so that 1.) all files are written to disk directly 2.) when data is requested, files are mapped into memory 3.) information about download status is stored as extended file attributes - added python test server, so we can easily simulate funny behaviour 2010/08/10, v.0.6.6: - added some functionality to the packager - testet packaging process on real-world project - changed file naming pattern from hash to hostname/path/to/file.type - cache info store now uses the filename as a key, still needs some cleanup work - added Xcode Project configuration files for all targets - updated demo to demonstrate packaging 2010/07/10, v.0.6.5: - Created new Xcode Project, I messed the old one up. Added targets for different architectures. - alpha of afcpkg commandline tool 2010/07/10, v.0.6.4: - Fixed a bug when an If-Modified-Since Rrequest was fired to revalidate the cached object. The delegate method connectionDidFinish: was called twice. 2010/07/10, v.0.6.3: - Added Framework target for OSX - Changed some ints to NSUInteger 2010/07/07, v.0.6.2: - Removed asImage method in AFCache to get rid of UIKit dependency - Removed assertion in cacheableItemFromCacheStore: that caused a termination of the running application when cache info store and filesystem became out of sync. Now just logging the error (if AFCACHE_LOGGING_ENABLED). There are still be some circumstances that lead to discrepancies between the filesystem and the cache info dictionary that seem to be software bugs, but they should not force a termination of the running program. TODO: observe the logs and try find out what is causing the cache info store not to be written. - Added Etag support. - Added Demo target - Added kHouskeepingInterval: housekeeping is only called every nth request - Added script to create FAT library for simulator and iOS 2010/07/01. v.0.6.1: - Added AFURLCache contribution by Nico Schmidt. - Fixed several flaws when dealing with different combinations of http headers - Added storeCachedResponse:forRequest: to AFURLCache. Not implemented yet, just checking if method is called for all requests. Unfortunately this method is NOT called for implicit requests, e.g. . Would be the ideal place to fill the cache. - added housekeeping: in AFCache class which is called when saving the cache's state (via archive:) 2010/04/28: - Started versioning in with v.0.6. - Transformed the classes into a static library and set up an Xcode Project - Added unit tests for the following response types: - with expire header - with max-age header - with out expire or max-age - with expire header, while switching the cache into offline mode and back - Added php script for use in unit tests - Added AFCacheableItemInfo to hold requestTimestamp, responseTimestamp, serverDate, lastModified, age, maxAge, and expireDate - Renamed expireDates dictionary in AFCache.m to cacheInfoStore - cacheInfoStore now stores AFCacheableItemInfo objects instead of NSDate objects holding the expire date, which enables the correct use of AFCache.m's "isFresh:" method - Removed some hacks for using the cache offline and introduced an "offline mode" - Now doing an If-Modified-Since request if object is stale instead of doing a regular request which then might be canceled. Though we were not doing an additional request with the old method, packets were transferred through the network to be dropped by the kernel's tcp stack which costs unnessessary bandwidth. - Introduced cacheStatus in AFCacheableItem to hold one of the following statuses: kCacheStatusNew: object is new, was not in cache before kCacheStatusFresh: object is delivered from cache kCacheStatusModified: object is in cache, but stale. An If-Modified-Since request was made to check the validity of the cached object. IMS request returns 200 (object has been modified). kCacheStatusNotModified: object is in cache, but stale. An If-Modified-Since request was made to check the validity of the cached object. IMS request returns 304 (object has NOT been modified). kCacheStatusRevalidationPending: used internally to determinate how to handle the status code of a pending request. - cleaned up code and reformatted it - Refactored NSDate+Parsing to DateParser because of Problems using categories from a static library in unit tests - Added documentation - Added CHANGES document ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS ================================================ FILE: README.markdown ================================================ ## Current Version 0.9.10 ## Current active branch develop ## What is AFCache? AFCache is an HTTP disk cache for use on iPhone/iPad and OSX. It can be linked as a static library or as a framework. The cache was initially written because on iOS, NSURLCache ignores NSURLCacheStorageAllowed and instead treats it as NSURLCacheStorageAllowedInMemoryOnly which is pretty useless for a persistent cache. ## Goals * Build a fully RFC2616 compliant cache instead of doing simple time-based caching **Status: Works for general use, some edge cases might not be compliant/implemented yet.** * Provide an offline mode to deliver content from cache when no network is available **Status: Works fine** * Provide a packaging mechanism to pre-populate the cache for accessing content offline **Status: Works fine and is used in several real-world apps. A packaging-tool exists in two flavours: Obj-C and python.** * Allow caching of UIWebView resources by overriding NSURLCache **Status: Works, but since iOS4 there's some trouble with AJAX requests. Might be due to an iOS Bug.** ## Sounds like something I need. Where can I get documentation? Good question ;) Documentation is always lacking, but you may check the [FAQ](https://github.com/artifacts/AFCache/wiki/FAQ) first. In the AFCache-iOS Xcode-project you'll find example controllers that use AFCache in different ways. See CHANGES for release notes. ## History * Started with master on github after AFCache was already used in some apps. * Branched to "bip" for two large projects (iOS and OSX) where AFCache was tested quite thorough and gained a lot of it's maturity (e.g. caching on disk, packaging, authentication). * Added "engine room" for logging (OPTIONAL) in branch bip: https://github.com/bkrpub/EngineRoom * dropped old master, saved it as branch "pre0.7" * moved "bip" branch to master, bip might be dropped in the future or might be a playground for new features ## API The API has changed from master to branch bip, but it should be easy to migrate. The old master branch moved to branch "pre0.7", but I strongly suggest you to move ahead and migrate to the new master. ## Project status AFCache is used in several iPhone applications in several versions. It is constantly evolving and therefore considered beta. Done: Currently I am doing some major changes and additions like a packaging tool and testing it on two large real-world projects (iPhone and OSX apps). Done: After sucessfully integrating AFCache into these projects I'll extend the demos and some documentation to make it a useful library for the public. The test cases are (still) not maintained very well. ## Branches * master: currently up to date with develop (0.9.9) Outdated: * Every other than develop ## Logging Logging is achieved via an AFLog macro which is either * just a replacement for NSLog (or nothing if undef'd) * a logpoint for EngineRoom, a sophisticated logging framework that enables dynamic logging manipulation at runtime, From the EngineRoom docs: The basic idea is to make the log message a first class citizen. LogPoints are data structures which can be manipulated (i.e. enabled / disabled) at runtime. This is achieved by creating static structures in a separate linker segment. You may checkout EngineRoom here (https://github.com/bkrpub/EngineRoom) and link AFCache against it by defining USE_ENGINEROOM and adding EngineRoom-OSX.xcodeproj to your project. ## Issues (Open) * Displacement strategy: still commented out, is on top of the refactoring list * Package file handling strategy not completely clear. Right now, a package is removed right after extracting. One might want to track which packages have been extracted yet. This also has to play nice with the file displacement strategy. * still very unhappy with the cleanup method. Need a clever displacement algorithm here. * the code to determine cache file size on disk is commented out, because there's a bug in it. Don't use this release for production. * synchronized requests are not testet well * instead of using a php script for the server part, an integrated http server for unit testing might be better. Maybe also mock objects for NSResponse objects could do it. * Maybe the mimetype should be added to the manifest file? * Make encryption optional. Right now, there's encryption code in the zip classes. ## Issues (Done) * Big file should be streamed to disk directly instead of holding them in an AFCacheableItem in memory. * The OSX framework and the iOS library are now seperate Xcode-projects, which is less hassle. ## Anatomy of the manifest file The manifest.afcache file contains an entry for every file contained in the archive. One entry looks like this: URL ; last-modified ; expires\n ; mimetype Note the delimiter, which is " ; " (space semicolon space) The mimetype is optional. Example: http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png ; Sat, 27 Mar 2004 18:43:30 GMT+00:00 ; Thu, 29 Jul 2010 14:17:20 GMT+00:00 ; text/html The URL MUST ne properly encoded and MUST NOT contain a hash at the end or parameters. Since the file path is calculated based on the URL, it's not necessary to include it in the manifest file. The dates have to be formatted according to rfc1123. Example: "Wed, 01 Mar 2006 12:00:00 GMT" ## Anatomy of the package zip file The zip file structure resembles the URL: hostname/path/to/file.suffix The zip file contains all files collected by the packager and the manifest file. Optionally, it includes userdata. ## Build notes when using AFCache in your project You need to link to SystemConfiguration.framework and libz.dylib to compile. Since AFCache uses Objective-C Categories, you need to add the following options to the linker (Targets/YourProject, Info, Build Settings: "Other linker flags") -ObjC -all_load For more information see: http://developer.apple.com/mac/library/qa/qa2006/qa1490.html ## How to run the unit tests (outdated) The unit tests currently depend on an existing HTTP-Server e.g. Apache. A simple php script is provided to answer the requests properly. Put the script on your htdocs directory and configure the URL in LogicTests.m, e.g. static NSString *kBaseURL = @"http://127.0.0.1/~mic/afcache/"; For more information see CHANGES. I am frequently using Charles as an HTTP debugging proxy which is superb for finding irregularities. http://www.charlesproxy.com/ ## Copyright Copyright 2008, 2009, 2010, 2011, 2012, 2013 Artifacts - Fine Software Development http://www.artifacts.de Authors: Michael Markowski (m.markowski@artifacts.de) Lars Blumberg Sebastian Grimme Claus Weymann Nico Schmidt (Savoy Software) Björn Kriews (bkr (0x40) jumper.org) Christian Menschel (post at cmenschel.de) ## License Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: configs/EngineRoom.xcconfig ================================================ // CFLAGS must be non-empty because of an Xcode bug as of 3.2.5 - may not even contain leading or trailing spaces ENGINEROOM_CFLAGS = "-DDONT_USE_ENGINEROOM" ENGINEROOM_LDFLAGS = "" // // uncomment the lines below to build against EngineRoom // // EngineRoom sources must be located beneath the AFCache sources // you must use a shared build directory and EngineRoom must // already be built as "Debug" and/or "Release" as needed // this is a bit complicated because I didn't want to mess up // AFCache with the dependency. // // A better approach could be to modify the "Build All" target // in AFCache to: recognize EngineRoom availablity and to use xcodebuild // to build EngineRoom with the correct configuration and then // AFCache itself defining these build settings on the commandline. // This could also allow for including a (possibly unsatisfied) // reference to EngineRoom as a subproject. // // // If you come up with a better approach to conditionally build a framework // against another one: please let me know. Thanks. // // Bjoern Kriews - bkr (0x40) jumper.org // // Current solution: these settings are overridden by the AFCacheOSX-EngineRoom target // if EngineRoom is available in ../EngineRoom //ENGINEROOM_CFLAGS = "-DUSE_ENGINEROOM -DER_EMBEDDED_NAME=AFCache" //ENGINEROOM_LDFLAGS = "-weak_framework EngineRoom" ================================================ FILE: configs/base.xcconfig ================================================ CURRENT_PROJECT_VERSION=0.7.1 ARCHS = $(ARCHS_STANDARD_32_64_BIT) //SDKROOT = macosx10.6 // don't define SDKROOT here or you will run into an xcode bug. that's what was told me ;) ONLY_ACTIVE_ARCH = YES PREBINDING = NO GCC_OPTIMIZATION_LEVEL = 0 GCC_C_LANGUAGE_STANDARD = gnu99 GCC_WARN_ABOUT_RETURN_TYPE = YES GCC_WARN_UNUSED_VARIABLE = YES ================================================ FILE: configs/debug/AFCache-OSX-debug.xcconfig ================================================ #include "../Base.xcconfig" ONLY_ACTIVE_ARCH = YES INSTALL_PATH = $(HOME)/Library/Frameworks COPY_PHASE_STRIP = NO DYLIB_COMPATIBILITY_VERSION = 1 DYLIB_CURRENT_VERSION = 1 FRAMEWORK_VERSION = A INFOPLIST_FILE = Info.plist PRODUCT_NAME = AFCache WRAPPER_EXTENSION = framework ALWAYS_SEARCH_USER_PATHS = NO GCC_ENABLE_FIX_AND_CONTINUE = YES GCC_DYNAMIC_NO_PIC = NO GCC_MODEL_TUNING = G5 GCC_OPTIMIZATION_LEVEL = 0 GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_PREFIX_HEADER = AFCache_Prefix.pch #include "../EngineRoom.xcconfig" OTHER_CFLAGS = $(ENGINEROOM_CFLAGS) OTHER_LDFLAGS = $(ENGINEROOM_LDFLAGS) ================================================ FILE: configs/debug/AFCache-iOS-debug.xcconfig ================================================ SDKROOT = iphoneos COPY_PHASE_STRIP = NO PREBINDING = NO PRODUCT_NAME = AFCache ALWAYS_SEARCH_USER_PATHS = NO GCC_DYNAMIC_NO_PIC = NO GCC_OPTIMIZATION_LEVEL = 0 ONLY_ACTIVE_ARCH = NO AFCACHE_LOGGING_ENABLED = YES ================================================ FILE: configs/debug/AFCacheDemoiOS-debug.xcconfig ================================================ SDKROOT = iphoneos CODE_SIGN_IDENTITY = iPhone Developer INSTALL_PATH = $(HOME)/Applications COPY_PHASE_STRIP = NO OTHER_LDFLAGS = -all_load -ObjC -framework Foundation -framework UIKit PREBINDING = NO INFOPLIST_FILE = AFCacheDemoiOS-Info.plist PRODUCT_NAME = AFCacheDemoiOS ALWAYS_SEARCH_USER_PATHS = NO GCC_DYNAMIC_NO_PIC = NO GCC_OPTIMIZATION_LEVEL = 0 GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h ================================================ FILE: configs/debug/AFCacheStatic-OSX-debug.xcconfig ================================================ INSTALL_PATH = /usr/local/lib COPY_PHASE_STRIP = NO OTHER_LDFLAGS = -all_load -ObjC -framework Foundation -framework AppKit PREBINDING = NO PRODUCT_NAME = AFCacheOSXStatic ALWAYS_SEARCH_USER_PATHS = NO GCC_ENABLE_FIX_AND_CONTINUE = YES GCC_DYNAMIC_NO_PIC = NO GCC_MODEL_TUNING = G5 GCC_OPTIMIZATION_LEVEL = 0 //GCC_PRECOMPILE_PREFIX_HEADER = NO //GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h ================================================ FILE: configs/debug/afcpkg-debug.xcconfig ================================================ INSTALL_PATH = /usr/local/bin COPY_PHASE_STRIP = NO OTHER_LDFLAGS = -framework Foundation -framework AppKit -ObjC -all_load PREBINDING = NO INFOPLIST_FILE = afcpkg.plist PRODUCT_NAME = afcpkg ALWAYS_SEARCH_USER_PATHS = NO GCC_ENABLE_FIX_AND_CONTINUE = YES GCC_DYNAMIC_NO_PIC = NO GCC_MODEL_TUNING = G5 GCC_OPTIMIZATION_LEVEL = 0 GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h ================================================ FILE: configs/debug/createFatLib-iOS.xcconfig ================================================ COPY_PHASE_STRIP = NO GCC_DYNAMIC_NO_PIC = NO GCC_OPTIMIZATION_LEVEL = 0 PRODUCT_NAME = createFatLib-iOS ================================================ FILE: configs/debug/testafcache-debug.xcconfig ================================================ // // testafcache-debug.xcconfig // AFCache // // Created by neonico on 8/12/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // PRODUCT_NAME = testafcache GCC_PREPROCESSOR_DEFINITIONS = AFCACHE_LOGGING_ENABLED COPY_PHASE_STRIP = NO GCC_DYNAMIC_NO_PIC = NO GCC_OPTIMIZATION_LEVEL = 0 ================================================ FILE: configs/release/AFCache-OSX-release.xcconfig ================================================ #include "../base.xcconfig" ONLY_ACTIVE_ARCH = YES DEBUG_INFORMATION_FORMAT = dwarf-with-dsym INSTALL_PATH = @executable_path/../Frameworks DYLIB_COMPATIBILITY_VERSION = 1 DYLIB_CURRENT_VERSION = 1 FRAMEWORK_VERSION = A INFOPLIST_FILE = Info.plist PRODUCT_NAME = AFCache WRAPPER_EXTENSION = framework ALWAYS_SEARCH_USER_PATHS = NO GCC_MODEL_TUNING = G5 GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_PREFIX_HEADER = AFCache_Prefix.pch #include "../EngineRoom.xcconfig" OTHER_CFLAGS = $(ENGINEROOM_CFLAGS) OTHER_LDFLAGS = $(ENGINEROOM_LDFLAGS) ================================================ FILE: configs/release/AFCache-iOS-release.xcconfig ================================================ SDKROOT = iphoneos DEBUG_INFORMATION_FORMAT = dwarf-with-dsym COPY_PHASE_STRIP = YES PREBINDING = NO PRODUCT_NAME = AFCache ALWAYS_SEARCH_USER_PATHS = NO GCC_ENABLE_FIX_AND_CONTINUE = NO ZERO_LINK = NO ================================================ FILE: configs/release/AFCacheDemoiOS-release.xcconfig ================================================ SDKROOT = iphoneos DEBUG_INFORMATION_FORMAT = dwarf-with-dsym CODE_SIGN_IDENTITY = iPhone Developer INSTALL_PATH = $(HOME)/Applications COPY_PHASE_STRIP = YES OTHER_LDFLAGS = -framework Foundation -framework UIKit PREBINDING = NO INFOPLIST_FILE = AFCacheDemoiOS-Info.plist PRODUCT_NAME = AFCacheDemoiOS ALWAYS_SEARCH_USER_PATHS = NO GCC_ENABLE_FIX_AND_CONTINUE = NO GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h ZERO_LINK = NO ================================================ FILE: configs/release/AFCacheStatic-OSX-release.xcconfig ================================================ INSTALL_PATH = /usr/local/lib COPY_PHASE_STRIP = NO OTHER_LDFLAGS = -all_load -ObjC -framework Foundation PREBINDING = NO PRODUCT_NAME = AFCacheOSXStatic ALWAYS_SEARCH_USER_PATHS = NO GCC_ENABLE_FIX_AND_CONTINUE = YES GCC_DYNAMIC_NO_PIC = NO GCC_MODEL_TUNING = G5 GCC_OPTIMIZATION_LEVEL = 0 ================================================ FILE: configs/release/afcpkg-release.xcconfig ================================================ DEBUG_INFORMATION_FORMAT = dwarf-with-dsym INSTALL_PATH = /usr/local/bin COPY_PHASE_STRIP = YES OTHER_LDFLAGS = -framework Foundation -framework AppKit PREBINDING = NO INFOPLIST_FILE = afcpkg.plist PRODUCT_NAME = afcpkg ALWAYS_SEARCH_USER_PATHS = NO GCC_ENABLE_FIX_AND_CONTINUE = NO GCC_MODEL_TUNING = G5 GCC_PRECOMPILE_PREFIX_HEADER = YES GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h ZERO_LINK = NO ================================================ FILE: configs/release/createFatLib-release-iOS.xcconfig ================================================ COPY_PHASE_STRIP = YES DEBUG_INFORMATION_FORMAT = dwarf-with-dsym GCC_ENABLE_FIX_AND_CONTINUE = NO PRODUCT_NAME = createFatLib-iOS ZERO_LINK = NO ================================================ FILE: configs/release/testafcache-release.xcconfig ================================================ // // testafcache-debug.xcconfig // AFCache // // Created by neonico on 8/12/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // PRODUCT_NAME = testafcache GCC_PREPROCESSOR_DEFINITIONS = AFCACHE_LOGGING_ENABLED COPY_PHASE_STRIP = NO GCC_DYNAMIC_NO_PIC = NO GCC_OPTIMIZATION_LEVEL = 0 ================================================ FILE: material/document-icon ================================================ %PDF-1.5 % 1 0 obj <>/OCGs[13 0 R]>>/Type/Catalog>> endobj 25 0 obj <>stream application/pdf document-icon Adobe Illustrator CS3 2010-11-24T13:39:17+01:00 2010-11-24T13:39:17+01:00 2010-11-24T13:39:17+01:00 196 256 JPEG /9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgBAADEAwER AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE 1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp 0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo +DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A9U4q7FWFfnX/AOSj83/9 sq6/5NHFXm35f/8AOMv5Qax5D8t6vf6VNJfajpdld3cgu7hQ0s9ukkhCq4AqzHYYqn//AEKf+SX/ AFaJ/wDpMuf+a8Vd/wBCn/kl/wBWif8A6TLn/mvFXf8AQp/5Jf8AVon/AOky5/5rxV3/AEKf+SX/ AFaJ/wDpMuf+a8Vd/wBCn/kl/wBWif8A6TLn/mvFXf8AQp/5Jf8AVon/AOky5/5rxV3/AEKf+SX/ AFaJ/wDpMuf+a8Vd/wBCn/kl/wBWif8A6TLn/mvFXf8AQp/5Jf8AVon/AOky5/5rxV3/AEKf+SX/ AFaJ/wDpMuf+a8Vd/wBCn/kl/wBWif8A6TLn/mvFXf8AQp/5Jf8AVon/AOky5/5rxV5D+SnmnzZ+ WnltfMM8T6l+Wd9qFxa6pHEC8+mTxyektyB1MbrxDe/gaclX1ppmp6fqmn2+o6dcR3djdxrLbXMT BkdGFQykYqicVdirsVdirsVdirsVdirsVYV+df8A5KPzf/2yrr/k0cVRf5T/APkrPJv/AGw9N/6g 48VZVirsVdirsVdirsVdirsVdirsVdirsVeN/wDOMdrbXf5TXNrdRJPbT6lqMc8Eih0dHkoyspqC CDQg4qkd/B5g/ITV2v8ATYptV/KPUJ+V7YDlJcaPLKaF4STvCzHv16GjUZlXumj6xpes6XbarpVz HeadeRiW2uYjVHQ9x+og7g7HFUZirsVdirsVdirsVeC+Tvzg/PjzjoEGvaD5J0y40y4Z0ile/ERJ ico3wuyt9pcVTv8Axd/zkv8A9SFpX/cSj/5rxVjH5m+Z/wA/7j8vfMUGs+TNNstJksJ1vruLUEke KEoebqgc8iB2xV65+U//AJKzyb/2w9N/6g48VZVirsVdirsVdirsVdirsVdirsVdirsVeQf84sf+ Svk/7at//wAncVetXVrbXdtLa3UST206NHPBIodHRxRlZTUEEGhBxV4TqOna1+RWtS61osU2o/lT qM3PV9ISskukyyGnrwV6xHuPoO/FsVe36PrGl6zpdtqulXMd5p15GJba5iNUdD3H6iDuDscVRmKu xV2KuxV2KvIP+cT/APySWkf8Z7z/AKiXxV6/irCvzr/8lH5v/wC2Vdf8mjiqL/Kf/wAlZ5N/7Yem /wDUHHirKsVdirsVdirsVdirsVdirsVdirsVdiryD/nFj/yV8n/bVv8A/k7ir1/FVk8EFxBJBPGs sEqlJYnAZHRhRlZTsQRsQcVeBavpnmH8idbk17y/FNqf5VX8vPWNDQl5NLkkIrPb1/3X+H7Lfsti r3HQtd0jX9ItdY0e6S9029QSW9xGaqyn8QQdiDuDsd8VR+KuxV2KuxV5B/zif/5JLSP+M95/1Evi r1/FWFfnX/5KPzf/ANsq6/5NHFUX+U//AJKzyb/2w9N/6g48VZVirsVdirsVdirsVdirsVdirsVd irsVeQf84sf+Svk/7at//wAncVev4q7FVskccsbRyKHjcFXRgCrKRQgg9QcVeEazo2t/khrdx5m8 s28uoflnqEvqeYfL0fxPpztsbu0B/wB1/wAy9KbHbiyqvatC13SNf0i11jR7pL3Tb1BJb3EZqrKf xBB2IO4Ox3xVH4q7FXYq8g/5xP8A/JJaR/xnvP8AqJfFXr+KsK/Ov/yUfm//ALZV1/yaOKov8p// ACVnk3/th6b/ANQceKsqxV2KuxV2KuxV2KuxV2KuxV2KuxV2Kvlv/nHT827byvbjyv5otzYaRq+o 3b6DrzbWzTerxlt5n6IQ9CD/AJW9BQ4q+pMVdirsVWyRxyxtHIoeNwVdGAKspFCCD1BxV4Hrnl3z F+SWv3HmvyhbS6l+XF8/q+Y/LUfxNYn9q6tQeiqOo7DZvhoyKvbPLnmPRfMmi2utaLdJeabeJzgn T7irA7qynZlO4OxxVMsVdiryD/nE/wD8klpH/Ge8/wCol8Vev4qwr86//JR+b/8AtlXX/Jo4qi/y n/8AJWeTf+2Hpv8A1Bx4qyrFXYq7FXYq7FXYq7FXYq7FXYq7FXYq8B/I/wAkeXfOv5G3mg69biez n1W/KOKCSGQS/DLE1Dxda7H6DUEjFUd5O84eYPyv1+1/L78wro3WhXJ9Pyl5uk2R0Gy2t0xJ4Ouw BJ2/1aEKvcMVdirsVaZVZSrAMrCjKdwQexxV4T5h8va5+TGuXPnHydbSX35f30nq+aPK8W5syftX lmvRVUfaXoBsfhoY1XsflnzPoXmfRbbWtDvI77TbpeUU0Z791YHdXU7Mp3GKppiryD/nE/8A8klp H/Ge8/6iXxV6/irCvzr/APJR+b/+2Vdf8mjiqL/Kf/yVnk3/ALYem/8AUHHirKsVdirsVdirsVdi rsVdirsVdirsVdiryD/nFj/yV8n/AG1b/wD5O4q9F84eT/L/AJv8v3Og69bC6sLobjo8bj7MsTfs uvY/wxV5J5W87+Yfyp8wWnkH8w7g3Xlu5Jj8recJNl4CgS2uyfslOnIn4dv2PiCr3UEEVG4PQ4q7 FXYq0yqylWAZWFGU7gg9jirwbzF5R8xfk7r93528i27X3ki7b1fNHlOOtYB+1d2a9AEG5H7I2+x9 hV6d/wArT8i/4F/xz+lI/wDDvp+p9Z/a5dPR9P7Xq8vh4da4qwz/AJxP/wDJJaR/xnvP+ol8Vev4 qwr86/8AyUfm/wD7ZV1/yaOKov8AKf8A8lZ5N/7Yem/9QceKsqxV2KuxV2KuxV2KuxV2KuxV2Kux V2KvGrb/AJxe8s2ayR6f5u81WEEkjym3tdRihiDyGrEIluBiqt/0LZpX/U9ecv8AuKp/1QxVCal/ zit5W1S2+q6n5u8131tyD+hc6jDNHyHQ8Xt2FRiqvB/zjJodvBHBb+dvN8MEShIoo9UjVFVRQKqi 3oAB2xVU/wChbNK/6nrzl/3FU/6oYq7/AKFs0r/qevOX/cVT/qhirv8AoWzSv+p685f9xVP+qGKt H/nGvSjsfPXnGn/bVT/qhir58/5VFoX/AEMZ/wAqo/SWpf4Z9T1/U9aP6z6v6K+uepy9L0uXP4a+ nXjt13xV9Cf84n/+SS0j/jPef9RL4q9fxVhX51/+Sj83/wDbKuv+TRxVF/lP/wCSs8m/9sPTf+oO PFWVYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXyr/wCv2f5/9S9ir0v/AJxP /wDJJaR/xnvP+ol8Vev4qwr86/8AyUfm/wD7ZV1/yaOKov8AKf8A8lZ5N/7Yem/9QceKsqxV2Kux V2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KvlX/1+z/P/qXsVel/84n/APkktI/4z3n/ AFEvir1/FWFfnX/5KPzf/wBsq6/5NHFUX+U//krPJv8A2w9N/wCoOPFWVYq7FXYq7FXYq7FXYq7F XYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXyr/6/Z/n/ANS9ir0v/nE//wAklpH/ABnvP+ol8Vev4qwr 86//ACUfm/8A7ZV1/wAmjiqL/Kf/AMlZ5N/7Yem/9QceKsqxV2KuxV2KuxV2KuxV2KuxV2KuxV2K uxV2KuxV2KuxV2KuxV2KvlX/ANfs/wA/+pexV6X/AM4n/wDkktI/4z3n/US+KvX8VYV+df8A5KPz f/2yrr/k0cVRf5T/APkrPJv/AGw9N/6g48VZVirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsV dirsVdirsVfKv/r9n+f/AFL2KvS/+cT/APySWkf8Z7z/AKiXxV6/irCvzr/8lH5v/wC2Vdf8mjiq L/Kf/wAlZ5N/7Yem/wDUHHirKsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdir5 V/8AX7P8/wDqXsVel/8AOJ//AJJLSP8AjPef9RL4q9fxVhX51/8Ako/N/wD2yrr/AJNHFUX+U/8A 5Kzyb/2w9N/6g48VZVirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVfKv8A6/Z/ n/1L2KvS/wDnE/8A8klpH/Ge8/6iXxV6/irCvzr/APJR+b/+2Vdf8mjiqL/Kf/yVnk3/ALYem/8A UHHirKsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdir5V/9fs/z/wCpexV6X/zi f/5JLSP+M95/1Evir1/FWFfnX/5KPzf/ANsq6/5NHFUX+U//AJKzyb/2w9N/6g48VZVirsVdirsV dirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVfKv/AK/Z/n/1L2KvS/8AnE//AMklpH/Ge8/6 iXxV6/irCvzr/wDJR+b/APtlXX/Jo4qi/wAp/wDyVnk3/th6b/1Bx4qyrFXYq7FXYq7FXYq7FXYq 7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq+Vf/X7P8/+pexV6X/zif8A+SS0j/jPef8AUS+KvX8VYV+d f/ko/N//AGyrr/k0cVRf5T/+Ss8m/wDbD03/AKg48VZVirsVfLv/ADkz+e3n3yj59ttB8o6sNPgg sY5b9fq9tMTPM7kCs8cpFIgh2p1xVnv/ADi/+Z3mLz35O1KbzJefXtY0++MbT+nDDWCSJWi+CFI1 +0HHTFXsuKsE/PPzNrflj8qte13Q7n6nqtkkBtrjhHLxL3MUbfBKroaq5G64q+O/+ho/z2/6mb/p x0//ALJ8Vd/0NH+e3/Uzf9OOn/8AZPir0D8hPz7/ADY81fmxoWg69rv1zSbz619ZtvqtnFy9Kzml T44oUcUdFOzYq+v8VdirsVdirsVdirsVdirsVdirsVfKv/r9n+f/AFL2KvS/+cT/APySWkf8Z7z/ AKiXxV6/irCvzr/8lH5v/wC2Vdf8mjiqL/Kf/wAlZ5N/7Yem/wDUHHirKsVdir85/wA8NebzF+bn mi/jczRC8kt4GHQxWaiBSvtxirir1H/nCfXxa+ddc0N2omp2K3Cb7GS0koBTx4XDH6MVfY+KvMP+ cmf/ACR3mj/jHa/9RsOKvhv8vLW2u/P/AJZtbqJLi2uNVsYp4JVDxvG9yisjq1QysDQg4q/Qn/lU /wCVn/Um6H/3DbP/AKp4qitL/L3yDpF/FqGleWtK0+/g5ejeWtjbQzJzUo3GSNFZeSsVND0OKsgx V2KuxV2KuxV2KuxV2KuxV2KuxV8q/wDr9n+f/UvYq9L/AOcT/wDySWkf8Z7z/qJfFXr+KsK/Ov8A 8lH5v/7ZV1/yaOKov8p//JWeTf8Ath6b/wBQceKsqxVLPNGtRaF5a1XWpSBHptnPdsW6fuY2en08 cVfnz+TuhT+a/wAzbHT5qzy3yX0k7NuWb6pNISfdm/HFUT/zj5r/AOg/zi8sXbOEinuvqUtfslbx GtxX5NIDir9EMVeYf85M/wDkjvNH/GO1/wCo2HFXw/8All/5Mjyp/wBtnT/+oqPFX6X4q7FXYq7F XYq7FXYq7FXYq7FXYq7FXYq+Vf8A1+z/AD/6l7FXpf8Azif/AOSS0j/jPef9RL4q9fxVhX51/wDk o/N//bKuv+TRxVF/lP8A+Ss8m/8AbD03/qDjxVlWKvJf+cpvMP6G/JnV0R+E+qyQafCfH1ZA8g+m GN8VeAf84Z6Obv8ANG71Bh+703TJnDeEk0kcSj6UL4q8l80W9x5b8/6rBb/u7jR9VnWCo6NbXDBD T/YjFX6T6Lqlvq2j2Gq2xrb6hbxXUJ8UmQSL+DYq88/5yZ/8kd5o/wCMdr/1Gw4q+FvI2pWWl+dv L+p30no2VjqVnc3UvFm4RQzo7txUMxoqk0Arir7j/wCho/yJ/wCpm/6cdQ/7J8VZN5H/ADb/AC98 83V1a+VtV/SM9miy3KfV7mDijHiDWeKIHfwxVl+KuxV2KuxV2KuxV2KuxV2KuxV2KvlX/wBfs/z/ AOpexV6X/wA4n/8AkktI/wCM95/1Evir1/FWFfnX/wCSj83/APbKuv8Ak0cVRf5T/wDkrPJv/bD0 3/qDjxVlWKvlv/nN/wAw0tfLHl2N/wC8kn1C4j/1AIYT/wAPLiqp/wA4P6Lw0zzTrjCvrz21lE1O noo8sgr7+smKvHP+cmdGOlfnT5hUCkV48N7EfETwozn/AJGcsVfWv/ONev8A6a/Jny9IzFprGN9P lr2+qyNHGB/zyCYq1/zkz/5I7zR/xjtf+o2HFXwRoWkXOta3p+j2rIlzqVzDZwPKSIxJPII1LlQx CgtvQHFXuX/QlX5p/wDV10P/AKSLz/skxV69/wA46fkR5v8Ay01jWL3XbzT7mLULeOGFbGSaRgyO WJb1YYRSngTir3bFXYq7FXYq7FXYq7FXYq7FXYq7FXyr/wCv2f5/9S9ir0v/AJxP/wDJJaR/xnvP +ol8Vev4qwr86/8AyUfm/wD7ZV1/yaOKov8AKf8A8lZ5N/7Yem/9QceKsqxV8If85Z+YRq35xXtq knOHRra3sUp9kNx9eQD3DzEH5Yq+j/8AnFHQzpf5MaZMy8ZNVnub5xSh+KT0UJ+ccKn5Yq8b/wCc 2tDFv5y0DWlWi39g9q7AbF7SUtX58bgDFWWf84ReYPW8veZPL7tvZ3UN9Ep/luYzG9PkbcV+eKvS f+cmf/JHeaP+Mdr/ANRsOKvh/wDLL/yZHlT/ALbOn/8AUVHir9L8VdirsVdirsVdirsVdirsVdir sVdirsVfKv8A6/Z/n/1L2KvS/wDnE/8A8klpH/Ge8/6iXxV6/irCvzr/APJR+b/+2Vdf8mjiqL/K f/yVnk3/ALYem/8AUHHirKWZVUsxCqoqzHYADucVfmR5419/MPnLW9cZ+Y1G+uLhCf5JJCUAr2CU AxVHL+VP5osoZfJ2uMrCqsNNuyCD3H7vFUHq/kLz1otkb7WPLmqabZKwRrq8sriCIM2ygvIirU9t 8Veq/wDOHmv/AKO/Nk6czUj1mwntwpNKyQ0uFI8SFicfTir6S/5yZ/8AJHeaP+Mdr/1Gw4q+H/yy /wDJkeVP+2zp/wD1FR4q/S/FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXyr/6/Z/n/ANS9ir0v/nE/ /wAklpH/ABnvP+ol8Vev4qwr86//ACUfm/8A7ZV1/wAmjiqL/Kf/AMlZ5N/7Yem/9QceKqX5weYf 8Pflh5m1ZX9OWCwmS3fwmnHow/8AJSRcVfnz5A0I6/540DReHNdQ1C2glH/FbyqJCadglScVfpri rzr/AJyG0Maz+TXme348pLe1+ux06g2brcEj/YxkfLFXwz+Vmv8A+H/zH8t6uWCx2uoW5nY7D0Xc JLv/AMY2bFX25/zkz/5I7zR/xjtf+o2HFXw/+WX/AJMjyp/22dP/AOoqPFX6X4q7FXYq7FXYq7FX Yq7FXYq7FXYq7FXYq+Vf/X7P8/8AqXsVel/84n/+SS0j/jPef9RL4q9fxVhX51/+Sj83/wDbKuv+ TRxVF/lP/wCSs8m/9sPTf+oOPFUN+bv5eXH5g+TJvLEWq/oiO5mhkuLn0PrPJIW5iPh6kPVwpry7 dMVeYfll/wA4l2/krzvpnmefzL+lV01pHSyNj6AZ3ieNW9T6xLTgX5D4eoxV9BYqhdV06DU9LvNN uN4L2CS3lFK/BKhRtj7Nir5f/wChGP8Av9v+5X/2eYq988/eQ7jzj+XN55PudT9C4vYLeKbVfR9S rwSRytJ6PqJ9sx9Oe1e+KvFvLP8Azhj+g/Mmk61/jD6x+i7y3vfq/wCjeHqfV5Vl4c/rTceXGlaG mKvpfFXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXyr/AOv2f5/9S9ir0v8A5xP/APJJaR/xnvP+ol8V ev4qwr86/wDyUfm//tlXX/Jo4qi/yn/8lZ5N/wC2Hpv/AFBx4qyrFXYq7FXYq7FXYq7FXYq7FXYq 7FXYq7FXYq7FXYq7FXYq7FXYq+Vf/X7P8/8AqXsVel/84n/+SS0j/jPef9RL4q9fxVIfPnlyfzL5 L1ry/BMtvNqlnNaxzuCVRpUKhiBvQVxV5lo35d/85E6PpFjpFh560uOx063itLSM6crFYoEEcYLM hJoqjc4qjP8ACP8Azkv/ANT7pX/cNj/5oxV3+Ef+cl/+p90r/uGx/wDNGKu/wj/zkv8A9T7pX/cN j/5oxV3+Ef8AnJf/AKn3Sv8AuGx/80Yq7/CP/OS//U+6V/3DY/8AmjFXf4R/5yX/AOp90r/uGx/8 0Yq7/CP/ADkv/wBT7pX/AHDY/wDmjFXf4R/5yX/6n3Sv+4bH/wA0Yq7/AAj/AM5L/wDU+6V/3DY/ +aMVd/hH/nJf/qfdK/7hsf8AzRirv8I/85L/APU+6V/3DY/+aMVd/hH/AJyX/wCp90r/ALhsf/NG Ku/wj/zkv/1Pulf9w2P/AJoxV3+Ef+cl/wDqfdK/7hsf/NGKu/wj/wA5L/8AU+6V/wBw2P8A5oxV 3+Ef+cl/+p90r/uGx/8ANGKu/wAI/wDOS/8A1Pulf9w2P/mjFWK6pqH/ADkXp/5haJ5Kfzlpz3Wt 21xdRXY06IRxrbKWKspSpJ44qyr/AAj/AM5L/wDU+6V/3DY/+aMVd/hH/nJf/qfdK/7hsf8AzRir D/8AoXn84P8AlYX/ACsH/GOm/wCKP+Wv6meH+831T+6p6f8Ac7dPfrirMP8AnE//AMklpH/Ge8/6 iXxV6/irsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVeQebv/Wl/IX/bK1L/AJNv ir1/FXYq7FXy3+QP5/flj5O/LHTtB17UZbfU7eW5eWJLaeUASzs6/Eisv2WxV6L/ANDYfkl/1d5/ +kO5/wCaMVd/0Nh+SX/V3n/6Q7n/AJoxV3/Q2H5Jf9Xef/pDuf8AmjFXf9DYfkl/1d5/+kO5/wCa MVd/0Nh+SX/V3n/6Q7n/AJoxV3/Q2H5Jf9Xef/pDuf8AmjFXf9DYfkl/1d5/+kO5/wCaMVd/0Nh+ SX/V3n/6Q7n/AJoxV3/Q2H5Jf9Xef/pDuf8AmjFXf9DYfkl/1d5/+kO5/wCaMVd/0Nh+SX/V3n/6 Q7n/AJoxV3/Q2H5Jf9Xef/pDuf8AmjFXf9DYfkl/1d5/+kO5/wCaMVd/0Nh+SX/V3n/6Q7n/AJox V3/Q2H5Jf9Xef/pDuf8AmjFXf9DYfkl/1d5/+kO5/wCaMVd/0Nh+SX/V3n/6Q7n/AJoxV3/Q2H5J f9Xef/pDuf8AmjFXf9DYfkl/1d5/+kO5/wCaMVd/0Nh+SX/V3n/6Q7n/AJoxViun/mb5P8+/85F+ TLzyzdPdQWWnajDcM8UkJDtE7AASKtdsVfROKuxV2Kv/2Q== uuid:D742428F62F9DF11AA7ECFD824F7F6D8 uuid:a5c3e3fc-180b-2f4c-a7db-f62e6607ddd0 1 False False 800.000000 600.000000 Pixels Futura-CondensedMedium Futura Condensed Medium TrueType 6.1d5e1 False Futura.ttc Cyan Magenta Yellow Black Standard-Farbfeldgruppe 0 Document Adobe PDF library 8.00 endstream endobj 2 0 obj <> endobj 13 0 obj <> endobj 14 0 obj [/View/Design] endobj 15 0 obj <>>> endobj 12 0 obj [13 0 R] endobj 5 0 obj <>/ArtBox[70.5 186.161 330.772 525.473]/MediaBox[0.0 0.0 800.0 600.0]/Thumb 24 0 R/TrimBox[0.0 0.0 800.0 600.0]/Resources<>/ProcSet[/PDF/Text]/Properties<>/ExtGState<>>>/Type/Page/LastModified(D:20101124133916+01'00')>> endobj 19 0 obj <>stream HRN1 +|zm'IRzZH|E"Q>viy8QY&v2^N#p>"zlΗgx#[j)I;AlK7B0OQ♜(÷D;XbGx5/q£qbW4U4PJXCÁr2A}決]{iwV1jloa1թ DzZABp@iYd㿀Wp endstream endobj 24 0 obj <>stream 8;Z]`5n8Df&-P;us$=A/![kkq)Db#/Fs#gB@8X+kLj#bVq2H1d&e$E+:8W8[;T,Z, LbbKV1lR5KI)s71+gKup`'18YfSB-'H284/0JG17Ef>0u#C!`9#hLg!7R)_U`q]FS )X8nUaODbScD0rB5T:M\]&a`AXM+sQkTf)RNG],C~> endstream endobj 16 0 obj <> endobj 17 0 obj <> endobj 18 0 obj <> endobj 21 0 obj <>stream HV XTe~ϽaAT WH !LBbh؟>ZYYic+H*fZnڪi`[ۏ0{/#kyss=̅hP9:{y34%4l#I, .ի \2lJ遼kG)%s'H)сHs '}'@ߧC+ޱ|2N0ҒOra54NZ%\xKާ~xlƬezlfaEנIr;z㨮Ɠr٪*ETE[LmרԜxSlf`v`萛7Z%Q0вi8ZYÆ03|)J4pH;]:JgqH{$@I!%Kx XI̔rRi|P>S>W5ժj':_}Nݤhzs=BoGv=N'6-ή-P{=mjfϳ~xwSY;^A)| @ i!$RAl+]tG$E)$SeD"SD,-s{kZO(T[vnØ{' sD Mww/|LlHM黂34bofxokXPTcݵuPmu'뎜\BڽV{)k_}66T8d#xc6{OHa$^ښhj;DIw#NH6$^ݐbBm_]*ڠ} 603e=|/6n`7^+d؄77Ww:~VƯpr#f+=]v*NO): b'>ͱw>cJv >Jz"ޭij>JO>GyZsB-'N>?DSfl:$ZB59_4R [M˒̚a%DKgذOnnoKAZLKۓa; agD()\YpL1-3d9 ?'E5}_"`=9Wp}OMhXN2e@I *_tVΨD̘|+.^%B$V%dscӒƦ5ݍ# IfMϗ.yErAz%!"0pM6^69sep_JpQthB ݼyc3c-+m.jJ-iӼ-%= F /kr4RdT%K#X'DRf5ҔjZ!r#10q3rEW69Q(XS0mi >_dBt*ciVn$=3   w2ҵʯsAA 0v򦝅{K-4T!mb,q5*(Հ|1d;%[6xzD)YãG .qKY\UB2Q۾1RCd5LXyqXl0dӎ)^-p,yqOʼ'Җi FE2EDŏ< 6 Lj0`Tg9LBN^.^ް,T'4RWZ&W20&e0ܲ Ep]VaN ưA0ΐLpwSqYWV )2Lp J7 J;sp*ji>dA>̇qb? y6ND +/.J z$k1~#nqU4䁙yrz{qkGy2"V;̤">J"iF xZ!%~=NPטa5j+1U:.7Ce>~̀gLNHl$K7LHu:=$NM9r6`EkT Wyx\1їQ~,Lw<.G!GWzޢ՗K~q;껊5c\FxK|MW}/DS:B?ggW%ztsh1-Z eq|UwYGhnvSh*@h:͠4ntLs4Bꧻi3C[S>M{>,}xtvc5Z*Lߢ,}W%z7C't~D$\N@72MnZ~S=n~R]MTQ~m2IPP(DZ(! mJhmD:Li&ZA7AOpO ts<@/K2BU:N'B&Eo;.G>g9}A_o{7~~1@#$f1T630p&8 bX ЎEb,F. #+R,C7JUZuHc2j9c X z܀! c܈u 1q nmw@b%/ T ܉ 0Q؈M4fl؊m؎{p/x!x1GQ߈zcuc*O%ڤ\uʉa>2_ЬFb9UaM*oW],ui]ӊm^STCu>o&TkpF6ZeW;5kk;ؔ- empR]z`_jj%֣ꖀܙ$N9vL^hJyJ=NiXvFiTxua,18zQbU KԏbHʻ'.RQz[V 1=1 ْDƀ;tfG6=p!7"\p.d!^Y2,뢼WEݢ05Zu dR[>啊uMDn$YUXvfb |-y6'B1F4Kl5^V4>̃^!ltȏ0Oق׃-lg&J%gW+ձ; f*vu\W79Ö + 13 ċ8L6t;Z0y]8CFm,д]׍Z`]SorAO3&J2%R:+xo mf`/]nPߘl#)4ar暦\6pL4p5ASbFyQ~mJe& jCi=؈Ә4VD-7jV$y::^ca)B$^EDGE4z-,@X^|KX``2\EgI!-9s,Y$)qhAv6봭# endstream endobj 22 0 obj [/Indexed/DeviceRGB 255 23 0 R] endobj 23 0 obj <>stream 8;X]O>EqN@%''O_@%e@?J;%+8(9e>X=MR6S?i^YgA3=].HDXF.R$lIL@"pJ+EP(%0 b]6ajmNZn*!='OQZeQ^Y*,=]?C.B+\Ulg9dhD*"iC[;*=3`oP1[!S^)?1)IZ4dup` E1r!/,*0[*9.aFIR2&b-C#soRZ7Dl%MLY\.?d>Mn 6%Q2oYfNRF$$+ON<+]RUJmC0InDZ4OTs0S!saG>GGKUlQ*Q?45:CI&4J'_2j$XKrcYp0n+Xl_nU*O( l[$6Nn+Z_Nq0]s7hs]`XX1nZ8&94a\~> endstream endobj 6 0 obj <> endobj 7 0 obj <> endobj 8 0 obj <>stream %!PS-Adobe-3.0 %%Creator: Adobe Illustrator(R) 13.0 %%AI8_CreatorVersion: 13.0.0 %%For: (Michael Markowski) () %%Title: (Bildschirmfoto 2010-11-24 um 13.31.42) %%CreationDate: 11/24/10 1:39 PM %%BoundingBox: 70 186 331 526 %%HiResBoundingBox: 70.5 186.1611 330.7725 525.4727 %%DocumentProcessColors: Cyan Magenta Yellow Black %AI5_FileFormat 9.0 %AI12_BuildNumber: 409 %AI3_ColorUsage: Color %AI7_ImageSettings: 0 %%RGBProcessColor: 0 0 0 ([Passermarken]) %AI3_TemplateBox: 400.5 299.5 400.5 299.5 %AI3_TileBox: 120.5 -80 679.5 703 %AI3_DocumentPreview: None %AI5_ArtSize: 800 600 %AI5_RulerUnits: 6 %AI9_ColorModel: 1 %AI5_ArtFlags: 0 0 0 1 0 0 1 0 0 %AI5_TargetResolution: 800 %AI5_NumLayers: 1 %AI9_OpenToView: -704 780 1 1829 1062 26 0 0 50 75 0 0 1 1 1 0 1 %AI5_OpenViewLayers: 7 %%PageOrigin:0 0 %AI7_GridSettings: 72 8 72 8 1 0 0.8 0.8 0.8 0.9 0.9 0.9 %AI9_Flatten: 1 %AI12_CMSettings: 00.MS %%EndComments endstream endobj 9 0 obj <>stream %%BoundingBox: 70 186 331 526 %%HiResBoundingBox: 70.5 186.1611 330.7725 525.4727 %AI7_Thumbnail: 100 128 8 %%BeginData: 7386 Hex Bytes %0000330000660000990000CC0033000033330033660033990033CC0033FF %0066000066330066660066990066CC0066FF009900009933009966009999 %0099CC0099FF00CC0000CC3300CC6600CC9900CCCC00CCFF00FF3300FF66 %00FF9900FFCC3300003300333300663300993300CC3300FF333300333333 %3333663333993333CC3333FF3366003366333366663366993366CC3366FF %3399003399333399663399993399CC3399FF33CC0033CC3333CC6633CC99 %33CCCC33CCFF33FF0033FF3333FF6633FF9933FFCC33FFFF660000660033 %6600666600996600CC6600FF6633006633336633666633996633CC6633FF %6666006666336666666666996666CC6666FF669900669933669966669999 %6699CC6699FF66CC0066CC3366CC6666CC9966CCCC66CCFF66FF0066FF33 %66FF6666FF9966FFCC66FFFF9900009900339900669900999900CC9900FF %9933009933339933669933999933CC9933FF996600996633996666996699 %9966CC9966FF9999009999339999669999999999CC9999FF99CC0099CC33 %99CC6699CC9999CCCC99CCFF99FF0099FF3399FF6699FF9999FFCC99FFFF %CC0000CC0033CC0066CC0099CC00CCCC00FFCC3300CC3333CC3366CC3399 %CC33CCCC33FFCC6600CC6633CC6666CC6699CC66CCCC66FFCC9900CC9933 %CC9966CC9999CC99CCCC99FFCCCC00CCCC33CCCC66CCCC99CCCCCCCCCCFF %CCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFFFF0033FF0066FF0099FF00CC %FF3300FF3333FF3366FF3399FF33CCFF33FFFF6600FF6633FF6666FF6699 %FF66CCFF66FFFF9900FF9933FF9966FF9999FF99CCFF99FFFFCC00FFCC33 %FFCC66FFCC99FFCCCCFFCCFFFFFF33FFFF66FFFF99FFFFCC110000001100 %000011111111220000002200000022222222440000004400000044444444 %550000005500000055555555770000007700000077777777880000008800 %000088888888AA000000AA000000AAAAAAAABB000000BB000000BBBBBBBB %DD000000DD000000DDDDDDDDEE000000EE000000EEEEEEEE0000000000FF %00FF0000FFFFFF0000FF00FFFFFF00FFFFFF %524C45FD0BFF7DFD04F827F8F8F827F8F8F827F8F8F827F8F8F827F8F8F8 %27F8F8F827F8F8F827F8F8F827F8F8F827F8F8F827F8F8F827F8F8F827F8 %27FD2CFF7DF8FFFD33A852F827FD2BFF7D27FD34FF52522727FD2AFF7D27 %FD34FF5252FFF827A8FD28FF7D27FD34FF2752FFFF2727FD28FF7D27FD34 %FF5227FFFFFFF827A8FD26FF5227FD34FF5252FD04FF27F8A8FD25FF7DF8 %FD34FF5227FD05FF27F8A8FD24FF7D27FD34FF5252FD06FF27F8A8FD18FF %7DA87D7D7DA87D7D7DA87D5227FD34FF5252FD07FF27F8A8FD17FFF8F827 %2727F8272727F827F827FD34FF2752FD08FF52F8A8FD16FFF8A8FD04FFA8 %FD04FF7D27FD34FF5227FD09FF27F87DFD15FFF8A8FD09FF7D27FD34FF27 %52FD0AFF52F8A8FD14FFF8A8FD09FF7D27FD34FF5227FD0BFF52F87DFD13 %FFF8A8FD09FF5227FD34FF5252FD0CFF52F87DFD12FFF8A8FD09FF7DF8FD %34FF5227FD0DFF52F87DFD11FF27A8FD09FF5227FD34FF5252FD0EFF7DF8 %7DFD10FFF8A8FD09FF7D27FD34FF5252FD0FFF7DF852FD0FFFF8A8FD09FF %7D27FD34FF2752FD10FF7DF87DFD0EFFF8A8FD09FF7D27FD34FF5227FD11 %FF7DF852FD0DFFF8A8FD09FF7D27FD34FF2752FD12FF7DF852FD0CFFF8A8 %FD09FF7D27FD34FF52F8FD13FF7DF852FD0BFFF8A8FD09FF5227FD34FF52 %F827FD13FFA8F852FD0AFFF8A8FD09FF7DF8FD34FF522727F8FD13FFA8F8 %27FD09FF27A8FD09FF5227FD34FF5252FF27F8FD13FFA8F827FD08FFF8A8 %FD09FF7D27FD34FF5252FFFF27F8FD13FFA8F827FD07FFF8A8FD09FF7D27 %FD34FF2752FFFFFF52F8FD13FFA8F827FD06FFF8A8FD09FF7D27FD34FF52 %27FD04FF52F8A8FD12FFA8F827FD05FFF8A8FD09FF7D27FD34FF2752FD05 %FF52F8FD13FFA82727FD04FFF8A8FD09FF7D27FD34FF5227FD06FF52F8A8 %FD12FFA827F8FFFFFFF8A8FD09FF5227FD34FF5252FD07FF52F8A8FD13FF %27F8FFFFF8A8FD09FF7DF8FD34FF5252FD08FF52F8A8FD13FF27F8FF27A8 %FD09FF5227FD34FF52F8275227522752275227F8F8522752275227522752 %2752275227522752275227F8F8F8A8FD09FF7D27FD34FFA8FD0B527DFD13 %527D52F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7D27FD55FFA8F8F8A8FD %09FF7D27FD56FFF8F8A8FD09FF7D27FD55FFA8F8F8A8FD09FF5227FD56FF %F8F8A8FD09FF7DF8FD55FFA8F827A8FD09FF5227FD56FFF8F8A8FD09FF7D %27FD55FFA8F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7D27FD55FFA8F8F8 %A8FD09FF7D27FD56FFF8F8A8FD09FF7D27FD55FFA8F8F8A8FD09FF5227FD %56FFF8F8A8FD09FF7DF8FD55FFA8F827A8FD09FF5227FD56FFF8F8A8FD09 %FF7D27FD55FFA8F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7D27FD55FFA8 %F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7D27FD55FFA8F8F8A8FD09FF52 %27FD56FFF8F8A8FD09FF7DF8FD55FFA8F827A8FD09FF5227FD56FFF8F8A8 %FD09FF7D27FD55FFA8F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7D27FD55 %FFA8F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7D27FD55FFA8F8F8A8FD09 %FF5227FD56FFF8F8A8FD09FF7DF8FD55FFA8F827A8FD09FF5227FD56FFF8 %F8A8FD09FF7D27FD55FFA8F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7D27 %FD55FFA8F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7D27FD55FFA8F8F8A8 %FD09FF5227FD56FFF8F8A8FD09FF7DF8FD55FFA8F827A8FD09FF5227FD56 %FFF8F8A8FD09FF7D27FD55FFA8F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF %7D27FD55FFA8F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7D27FD0DFF27F8 %F827A8FD08FFA8FD0BF827A8FD2DFFA8F8F8A8FD09FF5227FD0CFFA8FD04 %F8A8FD08FFA8FD0CF8FD2FFFF8F8A8FD09FF7DF8FD0CFFA8FD04F87DFD08 %FFA8FD0CF8A8FD2DFFA8F827A8FD09FF5227FD0CFF7DFD04F852FD08FFA8 %FD04F8527D7D527D527D52FD2FFFF8F8A8FD09FF7D27FD0CFF52FD04F827 %FD08FFA8FD04F87DFD35FFA8F8F8A8FD09FF7D27FD0CFFFD05F827A8FD07 %FFA8FD04F87DFD36FFF8F8A8FD09FF7D27FD0BFFA8FD06F8A8FD07FFA8FD %04F852FD35FFA8F8F8A8FD09FF7D27FD0BFF7DF8F82727F8F852FD07FFA8 %FD04F87DFD36FFF8F8A8FD09FF7D27FD0BFF52F8F85227F8F852FD07FFA8 %FD04F87DFD35FFA8F8F8A8FD09FF5227FD0BFF27F8F8527DF8F8F8FD07FF %A8FD04F87DFD36FFF8F8A8FD09FF7DF8FD0BFFF8F8F87D7DF8F8F8A8FD06 %FFA8FD04F852FD35FFA8F827A8FD09FF5227FD0AFF7DF8F8F8A8A8F8F8F8 %A8FD06FFA8FD04F87DFD36FFF8F8A8FD09FF7D27FD0AFF7DF8F8F8A8A8F8 %F8F852FD06FFA8FD04F852FD35FFA8F8F8A8FD09FF7D27FD0AFF52F8F827 %FFFFF8F8F827FD06FFA8FD04F87DFD36FFF8F8A8FD09FF7D27FD09FFA827 %F8F827FFFF27F8F8F8FD06FFA8FD0BF8A8FD2EFFA8F8F8A8FD09FF7D27FD %0AFFF8F8F852FFFF27F8F8F8A8FD05FFA8FD0BF8A8FD2FFFF8F8A8FD09FF %7D27FD09FF7DF8F8F852FFFF52F8F8F87DFD05FFA8FD0BF8A8FD2EFFA8F8 %F8A8FD09FF5227FD09FF52F8F8F8A8FFFF7DF8F8F827FD05FFA8FD04F852 %7D7D527D527DA8FD2FFFF8F8A8FD09FF7DF8FD09FF27F8F8F8A8FFFFA8F8 %F8F827A8FD04FFA8FD04F87DFD07FFA8FD2DFFA8F827A8FD09FF5227FD08 %FFA827F8F827FFFFFFA827F8F8F8A8FD04FFA8FD04F87DFD36FFF8F8A8FD %09FF7D27FD08FFA8F8F8F852FD04FF27F8F8F87DFD04FFA8FD04F852FD35 %FFA8F8F8A8FD09FF7D27FD08FF52F8F8F852FD04FF52F8F8F852FD04FFA8 %FD04F87DFD36FFF8F8A8FD09FF7D27FD08FF27F8F8F87DFFFFA8FF52F8F8 %F827FD04FFA8FD04F852FD35FFA8F8F8A8FD09FF7D27FD08FFFD05F827F8 %27F827F8F8F827FD04FFA8FD04F87DFD36FFF8F8A8FD09FF7D27FD07FFA8 %FD0EF8A8FFFFFFA8FD04F87DFD35FFA8F8F8A8FD09FF5227FD07FF7DFD0E %F87DFFFFFFA8FD04F87DFD36FFF8F8A8FD09FF7DF8FD07FF27F8F8F8277D %527D527D5227F8F8F852FFFFFFA8FD04F852FD35FFA8F827A8FD09FF5227 %FD07FF52F8F8F8A8FD06FF7DF8F8F827FFFFFFA8FD04F87DFD36FFF8F8A8 %FD09FF7D27FD06FFA8FD04F87DFD06FFA8FD04F8A8FFFFA8FD04F852FD35 %FFA8F8F8A8FD09FF7D27FD06FF7DFD04F8FD07FFA8FD04F8A8FFFFA8FD04 %F87DFD36FFF8F8A8FD09FF7D27FD06FF7DF8F8F827FD08FFFD04F852FFFF %A8FD04F852FD35FFA8F8F8A8FD09FF7D27FD06FF27F8F8F852FD08FF52F8 %F8F827FFFFA8FD04F87DFD36FFF8F8A8FD09FF7D27FD05FFA827F8F8F87D %FD08FF52FD04F8FFFFA8FD04F87DFD35FFA8F8F8A8FD09FF5227FD06FFA8 %FD17FFA8FD37FFF8F8A8FD09FF7DF8FD55FFA8F827A8FD09FF5227FD56FF %F8F8A8FD09FF7D27FD55FFA8F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7D %27FD55FFA8F8F8A8FD09FF7D27FD56FFF8F8A8FD09FF7DF827F827F827F8 %27F827F827F827F827F827F827F827F827F827F827F827F827F827F827F8 %27F827F827F827F827F827F827F827F827F827F827F827F827F827F827F8 %27F827F827F827F8272727F827F827F827F827F8F8F8A8FD09FFA8A87DA8 %7DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA8 %7DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA8 %7DA87DA87DA87DA87DA87DA82727A8A87DA87DA87DA87DA87DF8A8FD55FF %5227FD0BFF27A8FD55FF5252FD0BFFF8A8FD55FF5227FD0BFFF8A8FD55FF %5252FD0BFFF8A8FD55FF5227FD0BFFF8A8FD55FF5252FD0BFFF8A8FD55FF %5227FD0BFFF87DFFA8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FF %A8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8 %A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FF %A8FF2752FD0BFFFD58F827FD0AFFFF %%EndData endstream endobj 10 0 obj <>stream %AI12_CompressedDatax}z8I,!5$$!!B 8 'm?jnlJn,[,=9ؒURIU*U¡V;yB2bp, "J ~l SYЫu,A-thI".…5u|a𜗾 Ơf (/ }9F",&9.#VKe1C+1,ñA)[P$N$U dg;p\zJOׂ쨒ʡJ)n&9Ke<|S{ӑ0VZd,EI.1J0!|R TM'/e.ӑޅ OFS W+ltp?oe F޴E04Eul}j,0Kfod˲{BZ~k5F%6G5lFabV5~XPz,)>cYt(HB6zUPy.!2 y<:gU+҇JS/s*ˉ0py6Ƹt!ȱ`zcдzhM`.`\zԥAߜ|:OX/=*0z |n`6uq,eD%IjI))0SQdhk( ̇`Fw@Df%(f=X!TT V\̭Vqk Hއ_ oQq=q`S`|:Pu:7`D-uEveVUf35AbAA`zoFViF! =ܘt8fKOQٸ$gz,O!2j pw\C^ &GԬG3u`(hj0/CW{*h}  k;P`<ۍgCa$O*&&h ̱:b2"Z#>tFŸQAm?՗Z  ?%^TqO1O>k 3#smY*T%`-Kj}ѹa] RCtVRqָ6sL|NĈIh&U0/MGC~x.pS4wڹa0L'o!|Q7*p:4nL| S~`%B<dv8D? =Dp ˑ\!@t yi(0aJjoa!YUrèFSށih&p1 `5BQ]] DU+ ) f!̻0Nu= FsKH*$ Me'0X;᧲0LEoC{,IS3x#C7Ldb趽^ Bh?¿x~1nGex0޸=k F9Za˱fOw: !U?R\7o h ,(+AIRZPSFԷ'Lu'2A %7+ kȏy)됬H6࿔b~#H`F9Yyr2ͬ j R? 1h!X D H ~$=OkW^\@A3HSɱsNq5) ~ ۇnD SEatEā𮨧4֏y^[J= {?PvFAZ%l4Ra|˂YDN .CrNǍB\?<22AӇ1T ~>#/*x7S'@<?k29K]^R"/=-`Sڪ@kLYW\:!L[:[ߺF8D$A_BFK V1kZP0la'`L!'E2$!x<}d,zE֞!Hj;Yyf[_ w,/9*OD*iӟ Rꫬ'r܀1)]N _C\qbX:nx F QW@'p&dy9}TeZG H[f6nLD_/A nRCMØǵqw$T`yw7LSH+?D]yk[V$K9غݞvaak4_&Xʷ6/Oz URDOBv Qsu3MDc ȵ٣OmD>Eomyjږ$"!?I}REc:d&70e r}2 83U'e] O5T(ulH|\\P&,"(ZEm+&VG^SԵXI]{DN"0p?$e$%9 j~а!q!|QOu-J}ISV颮,!F)]?x>| aQ,m,3͙La'&ղZ H  R#\‡ǶkcRMWQ,:Q%lݠhuC!}o"P׌%[cCR+M?e/Be04 [D~/#o#:#ݺ1۔֑AqFqg_C0%#x{/q# "ػΐa*d|{pʣLw9ڔsy˓Ѐ+CcIXeq%xLy7nhY)kt>m/\z;Oi>|LUX$;H"taDfcb鼳V"~3UH&/Rj`ILH>ʸd`uW`UF;2bN$Y@=vdTi"aT"] -xT@)C\,x>Fת:X }cmm{h\OI X9M+&[?W8Z+X:p$j˪HnÁ׾>3)oږ>5a^j]bG s,)EFIͅՙYq lCgZD|.@81ousati||?,/VZW 6u{1"T„Z 69d\ ͛k9(ka14ُe?C2?QWzSBDs0aLK\\A!ɪ[uʺ/rFХct΋FBW1g'Pnn?Q@zc~0F2$$4E⊾<!W&F'2?1VbkX9ʍ[#w.B\VS\?&eV8^ﵜ qRps0V2Za[>r#zV0 `AQDӣ`WP|)H _5vAA_&$P`ZN( ȓ_(Hz0 }? SR*W@ '@C> :$[} jWŏǘ}z`se8(Ve3iCͫ|HQ YFc'WP[>~xeX&~?T2W:wUW/\9QJBdzFi:P8L4PM(#zJtx/ueNb]%<-<2B(~PmfR=y;=DމloW4ϛF啯#N o7}I>b䏽KPQ9=vRh]~i +է8mǹP9v% 7&82F;A =Za"O& t .¶_YINm|7&qiKz?vTCjZ>ǍN=s/C)KҮCzm]LNZ瞳̈́+З ֘ ,ɄH@+wzQNMP%"'W;l!ۻMl`kh.]'6@:iGbECmE]tM0/v_a}}=κM&݀¼eı=n1@B!I \k;{=ZJSn|*l9~w# MG'/JM8@7Lrp~ `d'V0ntTI(S;{bBkVC!3{!wt]9QC4’VơtY! 2?*{[4D$U9JCBݔ.f3F5`У)9Jܒzy{f[n\S7"'ӦUu$Eb.d.s[.lYOz0hs6 YJmª|vV&ް|Mg~0p% ˴tθ]R -F*C;,^{ M&!GG n45٦6.\I HBudh[ϵ9MVOέ=.-]"}Ֆ9MnpJM;1kj-ߓ0U讛z3X/& OhXP{fmfx` ʏXAefz\,v&(fbcJTI6%u?)lh,׹Ϛdt(1Z*(sߘh::%nKDN>=-붫wnT;%:udK@W^^Ty~oRgEE]re"hbK4P+l]%Ƹa,JeØ-k -1~_JHdePmO֝ ÐTqb㗡JpcNE庮҃^;nǼ |R&CT^bu![BW%%NqRc!]l]*wGa䶴xH@OeKo_e3Fa~6F .} tڧ` +а#70+ü(Ռ/sxw2Hud>\f|&l9?־0+595v?%Wdѓ t7f;$(LJuit %d6 ެ: iu7dtjZ6>/GG۲y#YԮR.4w!zXHvS|0Lk!/b lA =,6nfi̬(=9â# ҙ7jrq&K۠nQ<,^Eh$I6293@u>#CWͨc߳|rny 8q,UȾ--ۦ}1FGZN!ˢ*ƕΦº9@Cw ǗYݲ }&4Tщ@WzyC{C ˬ-϶,ڎ]ti%@<֊棸 a-iOmL?!DmnGǼQޥ)O]vB>$󌏈JXPOv'r4xGh\ Sa^0@R&X|V=?NVc0>p5z\:{Of\l"]Xɹa۱¾,hE^v<&%3dc{v7w^8!>,񕁍ݐқ"@kݥ/aH{\jWŠe{^Hh.{.)҇54mEenN>{Ԉ:̫4> z.<"ܖԕ/1͌""]W0ly\#鍳_Ys5LeO Vr9P9"'`=l~\Q6^䥪$YhnnѢOʏ]QJ@*w3~FЙ,CA&;-8w ]3Έ\2Ag.CAg\& E猡󎠳E .CA&,CAg$jy::"1td~iZ:rc%ctOncp>EpڔW bA8w{:m/9O.Q6MѾѻtAxKg|aY39G;>ռH7Dt!rI/s͹dB 9~U7j 6yL:CB0)_>Câ׍_?؍b= ο11v "|@8VrR4fw2Evtr*PsSzjby2)ȴ gXdy8hYakGZ8zpZ|q`$k8> a_tivOGgh>Щub̩s?8>j8>݂Iy~/&2,$y߂/2jl6HfA{*013C^X'G]q0OVe,2Ж<w~QL"<:8RG-6MC#,,gٴI<˓A$er{мˇyT+xr] Os|sEpuJqu v1__ c}ŋƋ-iʖ(lU>5zAڿIQW|qlۿ;U Pl=:Gv<.*͚}<'d\V^td8Oۍ(hUwcD2#&!#|/Fq|''CԊګ܁.\eoǮ7Qxإ#.W(sTnTnUo\,"[Υ"R5"[\_QD"RWz{5ح~k s\msX 9f2dr 4źhmP8.P^4Ν*W /ΩW%CV? ҕWvWv\"쌭Fx$ #Jl f0(z͸pYS[5Al>6khGM"%犰zPԋrƹ.gmPVδr:k%KE)Ы!P`8/⧡D庌 c:7X~`ZvlIִ{ZXp;[JJ}zmqg:JD va'~zEؽ_@QR ha*-@n(մRM#uFec0@>9Ž Qaa'g@뉷;P[>>!$KymF@% D^$ol*t6Ȼ^ |ƾ-nV.}>umjC4+ kSr$-Yu9#z]Oد]X"5jΐ|ȡ= |}VIMUϒVI-V ? ʋET\͑DT i,89ݲn7X`1ޓHg9Ss3o`ʡ<|K ZÜ ]oPyƷHhm&'*p'7ÖG<߉Xgӝ@/NoV 5;Թ!#cKVfm;ezcId'BM9{7+'[G=bfֽ7Tyr,g *f -zљw>od lo>c7F>h2_̽ G>+Nzuޮp[p;28;p;Z"o gP2UHG$C w+pg}#;/ni| w%PoE#¥3QQd[A;-Ô e|9ÝPf3|k1kM1Gk)j\KOF>&WX Y>Wj;Y0m| |`-y/|(]GZczaG%CxGiaL'bu &c+F)MbH>JW;҂0wNK$0aN"}UKKIgEC)ou1nMb×Z<8!鵱T|_ <2Z$S\I7tJ]BSTQϞ)#ڦ˃B[gCa}Pӿ mo_--ﬓc_%{T4&;-Ӟ.!N-[qey؞@jI"PVھ$^7ƙ) h=#ץG(axgRhG<ѵ=4 oIaxϭ )`m3pb$<h fıJ:hy}ބ T[t*"$!>UuaH5.Ci+l&ј];t҅Q>]^vi9rNb6estisf11vETߵԥ_fZKEv@szBz)⛻:*m>*0{Ti7A1> I1>= :Z3]r%"]uu0x&gie^NxL8V7n1Z]չcrmS*Mdif,[|}+1bZ j5}4rW\-fv!ï=LW#Vv)nP#^e0ُ:OݶCKuGi\"l%PģS)iS흲{P@6C4if+Pb1Xdz%+f@u/6OcØ_,\9gV4" #ˇ^Q,9WM m ߭&˨ODQ1ݶ EH%牎_ m u4aCSQ(@@=3 PQ&[IF6ߤ|[|f&sZ|yW/LR>7+9cF|毤K{;!;j5y~Ern(ʼ~TwC-3w^?껡ghwC_P^?dYy9oi^4bZ"ZA3uJ~tvesNa~sy.>Cά~.p ^{pټ~]|^?~o%Y,vh^?wLV뙏oTFV?|ITyOVmykj%P-gy(NWږk`~Qi{p&[.oAڟ3)1nH].-tVJXE^?~ئ~n'$oUX<V-k~.ݒՏ14o^آy(g#f[(<<ڊA`n2oў6:KVl+~\&ib^?o1Y?w^?W>ed[:U.E>||+Kso`xm|Ѽ~`xOY>[0MG #l</[mEEyVWgI\*KvmsA+H^?X.w@)-ρ1dQ7FN%>\Y:߁gV?˅yohf .ûrTJv[:Li˴xo\B(>^R@|c|o/YĨ9dΣW#-{xnkl}]lI}G^$F$V?I~wѻueR|'*Nhfab6E1Pr'тmӵr(;3Kqu΢ziV`.G;xGbS>>Wi-zh:zubOg@ӏ9$ql  zR՜r2zd4&;(P):'[j/ ˩zL2 snR*xcl ۏFzAq+6kqO/:J5ZR2}= Y`_/ưd=f]?Bגf]Q~ɢ♍bxoӨ-*J!֚hRHdSf WilE?}69mb92<6\2}La(NfgWx?keA 76ZfV"w˚m0ox|)]zzUo08m$X^7cyY4 BPhuĿ-WG#,nF_d_:>2W xd3d"w(^fCMᩒ;kKRR1*<%scq*F(2\6]l$ 9# w-үǪ|*MVZ>Y"=YUBh }6|f sNQp_ oYr?b M|`׵X"60V{6vcڣGol "YƘW,f6J qTN_I=L;{lMkZ`Is6tvD)*?s٬iUt2M`++'XrmNvA9QU}nsqvNlg½QfSz%lw KJmՑ P0c\,;dxX:jHv̱4~]1b)mF^%ʗF0ȁ8 z 3=J]\1}N[Ų|Fs\Ԑc֦0h1 YOfoC:.:okX1߂u)0AVuvKZHxTUOzy|M&׺5i"M9Ïd6mmiP妦ΘT Mp;v[\v굣pSiUM4ZcκE,k--uztt>(40/]>6fmrT^NGgrƯ0*@R6RhaD3^8 \' ?0(h()(Ct;IQ6@hO/Gφ&iEDg1a0QPYō#1x666=C{kQ5MN7N]6,RӪA /p,aCAq0 0 Ś$7_JEMGX qh*BO Vƺmj! x*U }>X3'R 2b? SFJ(ɞvݲ~l~%jb>RH;'&Gg`d>UdxS?5?Yf5?0UU@4>+4?hWf~&vD3@Yw h|64Ug ʌ@xgVD3#wegDEL4>}jegYVd~&X7?~#WR~4")e@x._I1wAïFa]e] _|k=wAo y>/Kӛ~4VVa,`u`״S~4ڣ|Mï~~hhL=ɓ7¥0͇$>ZD*ס]}v5,DM~!wAD1U>C"6DXZ|l[>(Ɔih[ւrk Rtc(`-ƻMg%-'Et/ 2 ۢP%6ھUUrD[UJ.vX2%~Ԛxt7D;N:]4rҡa;\MbG݆ S3Ca huy/~+mf//(^؏v(BOie.tl҇~ؔSWwZ'ҕޥVi]L^Us5w Q;TU4Q}>/DdȞM}rmDPN)5+-GQ%t(QSK3VRb\lVObS@u8KTp6kC%4S@r'X6LGJ۪]e_Lek%E]ЏשVP 7mANP\$| M  BKӹ]}ش1jp{[V0 L#1`%Z^ ̖| ?#1 mEϻoBmfI]˰JNFn?dcQa%Ie!(D4rY _4 endstream endobj 20 0 obj <> endobj xref 0 26 0000000003 65535 f 0000000016 00000 n 0000017247 00000 n 0000000004 00001 f 0000000011 00000 f 0000017510 00000 n 0000025502 00000 n 0000025574 00000 n 0000025745 00000 n 0000026708 00000 n 0000034290 00000 n 0000000000 00001 f 0000017485 00000 n 0000017298 00000 n 0000017369 00000 n 0000017400 00000 n 0000018520 00000 n 0000018633 00000 n 0000018816 00000 n 0000017882 00000 n 0000051399 00000 n 0000019082 00000 n 0000024941 00000 n 0000024989 00000 n 0000018196 00000 n 0000000148 00000 n trailer <<840DDCD1AC3A4D7586573D44D395F58B>]>> startxref 51576 %%EOF ================================================ FILE: resources/OSX/en.lproj/InfoPlist.strings ================================================ /* Localized versions of Info.plist keys */ ================================================ FILE: scripts/AFCacheOSX-EngineRoom.sh ================================================ #!/bin/bash set -e #set -x OSX_SDK=macosx10.6 OSX_ARCHS="x86_64 i386 ppc" ENGINEROOM_CFLAGS="-DDONT_USE_ENGINEROOM" ENGINEROOM_LDFLAGS="" ENGINEROOM_OSX="$SOURCE_ROOT/../EngineRoom/EngineRoom-OSX" if [ -e "$ENGINEROOM_OSX" ] ; then ENGINEROOM_CFLAGS="-DUSE_ENGINEROOM -DER_EMBEDDED_NAME=AFCache" ENGINEROOM_LDFLAGS="-weak_framework EngineRoom" pushd "$ENGINEROOM_OSX" xcodebuild -target EngineRoom-OSX -sdk $OSX_SDK -configuration "$CONFIGURATION" \ "BUILD_DIR=$BUILD_DIR" \ "ARCHS=$OSX_ARCHS" \ clean build popd fi # DERIVED_SOURCES_DIR is too "clean" XCCONFIG="$BUILD_DIR/AFCache.xcconfig" cat <<__EOCONFIG__ > "$XCCONFIG" ARCHS=$OSX_ARCHS ENGINEROOM_CFLAGS=$ENGINEROOM_CFLAGS ENGINEROOM_LDFLAGS=$ENGINEROOM_LDFLAGS __EOCONFIG__ xcodebuild -target AFCacheOSX -sdk $OSX_SDK -configuration "$CONFIGURATION" -xcconfig "$XCCONFIG" clean build exit 0 ================================================ FILE: scripts/createFatLib.sh ================================================ #!/bin/sh XCODE_BUILD_DIR="../build" set -e set -x xcodebuild -project ../AFCache-iOS.xcodeproj -target AFCache-iOS -sdk iphoneos "ARCHS=armv6 armv7" clean build xcodebuild -project ../AFCache-iOS.xcodeproj -target AFCache-iOS -sdk iphonesimulator "ARCHS=i386 x86_64" "VALID_ARCHS=i386 x86_64" clean build lipo -output ../release/libAFCache-iOS.a -create $XCODE_BUILD_DIR/Release-iphoneos/libAFCache-iOS.a $XCODE_BUILD_DIR/Release-iphonesimulator/libAFCache-iOS.a ./updateAPI.sh cp ../CHANGES ../release/ ================================================ FILE: scripts/updateAPI.sh ================================================ #!/bin/sh HEADER_DIR=../src/shared cat $HEADER_DIR/AFCacheableItemInfo.h > ../release/AFCacheLib.h.tmp cat $HEADER_DIR/AFCacheableItem.h >> ../release/AFCacheLib.h.tmp cat $HEADER_DIR/AFCache.h >> ../release/AFCacheLib.h.tmp cat $HEADER_DIR/AFURLCache.h >> ../release/AFCacheLib.h.tmp cat $HEADER_DIR/AFCacheableItem+Packaging.h >> ../release/AFCacheLib.h.tmp cat $HEADER_DIR/AFPackageInfo.h >> ../release/AFCacheLib.h.tmp cat $HEADER_DIR/AFCache+Packaging.h >> ../release/AFCacheLib.h.tmp cat $HEADER_DIR/AFCachePackageCreator.h >> ../release/AFCacheLib.h.tmp cat $HEADER_DIR/AFHTTPURLProtocol.h >> ../release/AFCacheLib.h.tmp cat $HEADER_DIR/AFMediaTypeParser.h >> ../release/AFCacheLib.h.tmp cat ../release/AFCacheLib.h.tmp | sed -e s,\#import.*,,g > ../release/AFCacheLib.h rm ../release/AFCacheLib.h.tmp ================================================ FILE: src/3rdparty/AFRegexString/AFRegexString.h ================================================ /* * AFRegexString.h * Adds regular expressions to NSString * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Author: Michael Markowski (m.markowski@artifacts.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #import @interface AFRegex : NSObject { } @end @interface NSString (AFRegex) - (NSString *)stringByRegex:(NSString*)pattern substitution:(NSString*)substitute; - (BOOL)matchesPattern:(NSString*)pattern; - (BOOL)matchesPattern:(NSString*)pattern options:(int)options; @end ================================================ FILE: src/3rdparty/AFRegexString/AFRegexString.m ================================================ /* * AFRegexString * Adds regular expressions to NSString * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Author: Michael Markowski (m.markowski@artifacts.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Borrowed rreplace function from: http://www.daniweb.com/code/snippet733.html * TkTkorrovi * * Influenced by CSRegex http://www.cocoadev.com/index.pl?CSRegex * by Dag Ågren aka WAHa * */ #import "AFRegexString.h" #import "regex.h" /* * Replaces all occurences and stores it in buf */ int rreplace (char *buf, int size, regex_t *re, char *rp) { char *pos; long long sub, so, n; regmatch_t pmatch [10]; /* regoff_t is int so size is int */ if (regexec (re, buf, 10, pmatch, 0)) return 0; for (pos = rp; *pos; pos++) { if (*pos == '\\' && *(pos + 1) > '0' && *(pos + 1) <= '9') { so = pmatch [*(pos + 1) - 48].rm_so; n = pmatch [*(pos + 1) - 48].rm_eo - so; if (so < 0 || strlen (rp) + n - 1 > size) return 1; memmove (pos + n, pos + 2, strlen (pos) - 1); memmove (pos, buf + so, n); pos = pos + n - 2; } } sub = pmatch [1].rm_so; /* no repeated replace when sub >= 0 */ for (pos = buf; !regexec (re, pos, 1, pmatch, 0); ) { n = pmatch [0].rm_eo - pmatch [0].rm_so; pos += pmatch [0].rm_so; if (strlen (buf) - n + strlen (rp) + 1 > size) return 1; memmove (pos + strlen (rp), pos + n, strlen (pos) - n + 1); memmove (pos, rp, strlen (rp)); pos += strlen (rp); if (sub >= 0) break; } return 0; } @implementation NSString (AFRegex) - (NSString *)stringByRegex:(NSString*)pattern substitution:(NSString*)substitute { regex_t preg; NSString *result = nil; // compile pattern int err = regcomp(&preg, [pattern UTF8String], 0 | REG_ICASE | REG_EXTENDED); if (err) { char errmsg[256]; regerror(err, &preg, errmsg, sizeof(errmsg)); // [NSException raise:@"AFRegexStringException" // format:@"Regex compilation failed for \"%@\": %s", pattern, errmsg]; return [NSString stringWithString:self]; } else { char buffer[4096]; char *buf = buffer; const char *utf8String = [self UTF8String]; if(strlen(utf8String) >= sizeof(buffer)) buf = malloc(strlen(utf8String) + 1); strcpy(buf, utf8String); char *replaceStr = (char*)[substitute UTF8String]; if (rreplace (buf, 4096, &preg, replaceStr)) { // [NSException raise:@"AFRegexStringException" // format:@"Replace failed"]; result = [NSString stringWithString:self]; } else { result = [NSString stringWithUTF8String:buf]; } if(buf != buffer) free(buf); } regfree(&preg); // fixme: used to be commented return result; } - (BOOL)matchesPattern:(NSString*)pattern { //TODO return NO; } /* OPTIONS: REG_EXTENDED Compile modern (``extended'') REs, rather than the obsolete (``basic'') REs that are the default. REG_BASIC This is a synonym for 0, provided as a counterpart to REG_EXTENDED to improve readability. REG_NOSPEC Compile with recognition of all special characters turned off. All characters are thus considered ordinary, so the ``RE'' is a literal string. This is an extension, compatible with but not specified by IEEE Std 1003.2 (``POSIX.2''), and should be used with caution in software intended to be portable to other systems. REG_EXTENDED and REG_NOSPEC may not be used in the same call to regcomp(). REG_ICASE Compile for matching that ignores upper/lower case distinctions. See re_format(7). REG_NOSUB Compile for matching that need only report success or failure, not what was matched. REG_NEWLINE Compile for newline-sensitive matching. By default, newline is a completely ordinary character with no special meaning in either REs or strings. With this flag, `[^' bracket expressions and `.' never match newline, a `^' anchor matches the null string after any newline in the string in addition to its normal function, and the `$' anchor matches the null string before any newline in the string in addition to its normal function. REG_PEND The regular expression ends, not at the first NUL, but just before the character pointed to by the re_endp member of the structure pointed to by preg. The re_endp member is of type const char *. This flag permits inclusion of NULs in the RE; they are considered ordinary characters. This is an extension, compatible with but not specified by IEEE Std 1003.2 (``POSIX.2''), and should be used with caution in software intended to be portable to other systems. */ - (BOOL)matchesPattern:(NSString*)pattern options:(int)options { //TODO return NO; } -(NSString *)escapedPattern { unsigned long len = [self length]; NSMutableString *escaped=[NSMutableString stringWithCapacity:len]; for(int i=0; i #import "AFCache.h" #import "AFCacheableItem.h" @interface CacheableItemDemoController : UIViewController { UITextView *log; UITextView *url; UIProgressView *progressView; UIButton *loadButton; UIButton *cancelButton; UIToolbar *toolbar; } @property (nonatomic, retain) IBOutlet UITextView *log; @property (nonatomic, retain) IBOutlet UITextView *url; @property (nonatomic, retain) IBOutlet UIProgressView *progressView; @property (nonatomic, retain) IBOutlet UIButton *loadButton; @property (nonatomic, retain) IBOutlet UIButton *cancelButton; @property (nonatomic, retain) IBOutlet UIToolbar *toolbar; - (IBAction)loadAction:(id)sender; - (IBAction)cancelAction:(id)sender; - (IBAction)clearAction:(id)sender; - (IBAction)dismissKeyboardAction:(id)sender; @end ================================================ FILE: src/Examples/CacheableItemDemoController.m ================================================ // // CacheableItemDemoController.m // AFCache // // Created by Michael Markowski on 31.08.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // #import "CacheableItemDemoController.h" @implementation CacheableItemDemoController @synthesize log, progressView, loadButton, cancelButton, url, toolbar; - (void)viewDidLoad { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil]; toolbar.alpha = 0; } - (void)viewDidUnload { [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (void)keyboardWillShow:(NSNotification*)notif { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.25]; toolbar.alpha = 1; [UIView commitAnimations]; } - (void)keyboardDidHide:(NSNotification*)notif { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.25]; toolbar.alpha = 0; [UIView commitAnimations]; } - (IBAction)loadAction:(id)sender { progressView.progress = 0.0f; loadButton.enabled = NO; int pending = [[AFCache sharedInstance].pendingConnections count]; log.text = [NSString stringWithFormat: @"Started request. Pending connections: %d", pending+1]; NSURL *theURL = [NSURL URLWithString:url.text]; if (theURL) { [[AFCache sharedInstance] cachedObjectForURL:theURL delegate:self]; } else { log.text = @"Invalid URL."; } } - (IBAction)dismissKeyboardAction:(id)sender { [url resignFirstResponder]; } - (IBAction)cancelAction:(id)sender { progressView.progress = 0.0f; [[AFCache sharedInstance] cancelAsynchronousOperationsForDelegate:self]; int pending = [[AFCache sharedInstance].pendingConnections count]; log.text = [NSString stringWithFormat: @"Canceled request. Pending connections: %d", pending]; loadButton.enabled = YES; } - (IBAction)clearAction:(id)sender { [[AFCache sharedInstance] invalidateAll]; log.text = @"Cleared cache completely."; } - (void) connectionDidFail: (AFCacheableItem *) cacheableItem { progressView.progress = 0.0f; log.text = [NSString stringWithFormat:@"FAIL.\n%@", [cacheableItem.error description]]; } - (void) connectionDidFinish: (AFCacheableItem *) cacheableItem { log.text = [NSString stringWithFormat:@"SUCCESS.\n%@", [cacheableItem description]]; loadButton.enabled = YES; } - (void) cacheableItemDidReceiveData: (AFCacheableItem *) cacheableItem { float totalSize = cacheableItem.info.contentLength; float currentSize = cacheableItem.currentContentLength; float percentage = currentSize / (totalSize/100); progressView.progress = percentage / 100; } - (void)dealloc { [toolbar release]; [log release]; [url release]; [progressView release]; [loadButton release]; [cancelButton release]; [super dealloc]; } @end ================================================ FILE: src/Examples/CacheableItemDemoController.xib ================================================ 1552 11G63 3084 1138.51 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin 2083 YES IBProxyObject IBUIBarButtonItem IBUIButton IBUILabel IBUIProgressView IBUITextView IBUIToolbar IBUIView YES com.apple.InterfaceBuilder.IBCocoaTouchPlugin PluginDependencyRecalculationVersion YES IBFilesOwner IBCocoaTouchFramework IBFirstResponder IBCocoaTouchFramework 274 YES 274 {320, 119} 1 MCAwIDAAA darkTextColor YES YES IBCocoaTouchFramework Press the "Load" button. 1 MC40NzY0MjYyNzk4IDEgMAA 2 IBCocoaTouchFramework Courier-Bold Courier 2 12 Courier-Bold 12 16 292 {{20, 144}, {42, 21}} NO YES 7 NO IBCocoaTouchFramework URL 3 MQA 1 10 1 17 Helvetica 17 16 292 {{20, 173}, {280, 78}} 1 MC45MTg0NzgyNjA5IDAuOTE4NDc4MjYwOSAwLjkxODQ3ODI2MDkAA YES YES IBCocoaTouchFramework http://localhost/~cweymann/huge.mov 2 IBCocoaTouchFramework 292 {{20, 315}, {72, 37}} NO IBCocoaTouchFramework 0 0 1 Load 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 3 MC41AA Helvetica-Bold Helvetica 2 15 Helvetica-Bold 15 16 292 {{99, 315}, {74, 37}} NO IBCocoaTouchFramework 0 0 1 Cancel 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 292 {{181, 315}, {74, 37}} NO IBCocoaTouchFramework 0 0 1 Clear 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 292 {{20, 127}, {280, 11}} NO IBCocoaTouchFramework 1 266 {{0, 207}, {320, 44}} NO NO IBCocoaTouchFramework 1 YES IBCocoaTouchFramework 5 IBCocoaTouchFramework 2 0 {{0, 20}, {320, 416}} 3 MC4zMzMzMzMzMzMzAA 1 IBCocoaTouchFramework YES view 3 loadButton 10 cancelButton 11 url 12 log 13 progressView 19 toolbar 27 delegate 28 loadAction: 7 17 cancelAction: 7 18 cancelAction: 7 21 clearAction: 7 22 dismissKeyboardAction: 26 YES 0 YES 1 YES -1 File's Owner -2 4 5 6 7 8 9 20 23 YES 24 25 YES YES -1.CustomClassName -1.IBPluginDependency -2.CustomClassName -2.IBPluginDependency 1.IBPluginDependency 20.IBPluginDependency 23.IBPluginDependency 24.IBPluginDependency 25.IBPluginDependency 4.IBPluginDependency 5.IBPluginDependency 6.IBPluginDependency 7.IBPluginDependency 8.IBPluginDependency 9.IBPluginDependency YES CacheableItemDemoController com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES YES 28 0 IBCocoaTouchFramework com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 YES 3 2083 ================================================ FILE: src/Examples/Demo-Info.plist ================================================ CFBundleDevelopmentRegion English CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFiles Icon57x57.png Icon114x114.png CFBundleIdentifier com.yourcompany.${PRODUCT_NAME:identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType APPL CFBundleSignature ???? CFBundleVersion 1.0 NSMainNibFile MainWindow ================================================ FILE: src/Examples/DemoAppDelegate.h ================================================ // // DemoAppDelegate.h // Demo // // Created by Michael Markowski on 25.08.10. // Copyright Artifacts - Fine Software Development 2010. All rights reserved. // #import @interface DemoAppDelegate : NSObject { UIWindow *window; UITabBarController *tabBarController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; @end ================================================ FILE: src/Examples/DemoAppDelegate.m ================================================ // // DemoAppDelegate.m // Demo // // Created by Michael Markowski on 25.08.10. // Copyright Artifacts - Fine Software Development 2010. All rights reserved. // #import "DemoAppDelegate.h" #import "AFCache.h" @implementation DemoAppDelegate @synthesize window; @synthesize tabBarController; #pragma mark - #pragma mark Application lifecycle - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Add NSURLCache to use AFCache in UIWebViews AFURLCache* urlCache = [[[AFURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:@""] autorelease]; [NSURLCache setSharedURLCache:urlCache]; // Add the tab bar controller's view to the window and display. [window addSubview:tabBarController.view]; [window makeKeyAndVisible]; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ } - (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, called instead of applicationWillTerminate: when the user quits. */ } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background. */ } - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ } - (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. See also applicationDidEnterBackground:. */ } #pragma mark - #pragma mark UITabBarControllerDelegate methods /* // Optional UITabBarControllerDelegate method. - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { } */ /* // Optional UITabBarControllerDelegate method. - (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed { } */ #pragma mark - #pragma mark Memory management - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { /* Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. */ } - (void)dealloc { [tabBarController release]; [window release]; [super dealloc]; } @end ================================================ FILE: src/Examples/Demo_Prefix.pch ================================================ // // Prefix header for all source files of the 'Demo' target in the 'Demo' project // #ifdef __OBJC__ #import #import #endif //#define RESUMEABLE_DOWNLOAD ================================================ FILE: src/Examples/MainWindow.xib ================================================ 800 10F569 788 1038.29 461.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin 117 YES YES com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES YES YES YES IBFilesOwner IBCocoaTouchFramework IBFirstResponder IBCocoaTouchFramework IBCocoaTouchFramework 1316 {320, 480} 1 MSAxIDEAA NO NO IBCocoaTouchFramework YES 1 IBCocoaTouchFramework NO CacheableItem IBCocoaTouchFramework CacheableItemDemoController 1 IBCocoaTouchFramework NO YES Packaging IBCocoaTouchFramework Packaging 1 IBCocoaTouchFramework NO NSURLRequest IBCocoaTouchFramework NSURLRequest 1 IBCocoaTouchFramework NO 266 {{129, 330}, {163, 49}} 3 MCAwAA NO IBCocoaTouchFramework YES window 9 delegate 99 tabBarController 113 YES 0 2 YES -1 File's Owner 3 106 YES 107 108 YES 109 YES 110 111 -2 125 YES 126 YES YES -1.CustomClassName -2.CustomClassName 106.IBEditorWindowLastContentRect 106.IBPluginDependency 107.IBPluginDependency 108.CustomClassName 108.IBPluginDependency 109.CustomClassName 109.IBPluginDependency 110.IBPluginDependency 111.IBPluginDependency 125.CustomClassName 125.IBEditorWindowLastContentRect 125.IBPluginDependency 2.IBAttributePlaceholdersKey 2.IBEditorWindowLastContentRect 2.IBPluginDependency 3.CustomClassName 3.IBPluginDependency YES UIApplication UIResponder {{550, 622}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin PackagingDemoController com.apple.InterfaceBuilder.IBCocoaTouchPlugin NSURLRequestDemoViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin CacheableItemDemoController {{0, 665}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES YES {{306, 283}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin DemoAppDelegate com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES YES YES YES 126 YES CacheableItemDemoController UIViewController YES YES cancelButton loadButton log progressView url YES UIButton UIButton UITextView UIProgressView UITextView YES YES cancelButton loadButton log progressView url YES cancelButton UIButton loadButton UIButton log UITextView progressView UIProgressView url UITextView IBProjectSource CacheableItemDemoController.h DemoAppDelegate NSObject YES YES tabBarController window YES UITabBarController UIWindow YES YES tabBarController window YES tabBarController UITabBarController window UIWindow IBProjectSource demo/DemoAppDelegate.h NSURLRequestDemoViewController UIViewController imageView UIImageView imageView imageView UIImageView IBProjectSource NSURLRequestDemoViewController.h PackagingDemoController UIViewController YES YES imageView textView webView YES UIImageView UITextView UIWebView YES YES imageView textView webView YES imageView UIImageView textView UITextView webView UIWebView IBProjectSource demo/PackagingDemoController.h PackagingDemoController UIViewController IBUserSource UIWindow UIView IBUserSource YES NSObject IBFrameworkSource AppKit.framework/Headers/NSAccessibility.h NSObject IBFrameworkSource AppKit.framework/Headers/NSApplication.h NSObject IBFrameworkSource AppKit.framework/Headers/NSApplicationScripting.h NSObject IBFrameworkSource AppKit.framework/Headers/NSColorPanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSControl.h NSObject IBFrameworkSource AppKit.framework/Headers/NSDictionaryController.h NSObject IBFrameworkSource AppKit.framework/Headers/NSDragging.h NSObject IBFrameworkSource AppKit.framework/Headers/NSFontManager.h NSObject IBFrameworkSource AppKit.framework/Headers/NSFontPanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSKeyValueBinding.h NSObject IBFrameworkSource AppKit.framework/Headers/NSMenu.h NSObject IBFrameworkSource AppKit.framework/Headers/NSNibLoading.h NSObject IBFrameworkSource AppKit.framework/Headers/NSOutlineView.h NSObject IBFrameworkSource AppKit.framework/Headers/NSPasteboard.h NSObject IBFrameworkSource AppKit.framework/Headers/NSSavePanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSTableView.h NSObject IBFrameworkSource AppKit.framework/Headers/NSToolbarItem.h NSObject IBFrameworkSource AppKit.framework/Headers/NSView.h NSObject IBFrameworkSource Foundation.framework/Headers/NSArchiver.h NSObject IBFrameworkSource Foundation.framework/Headers/NSClassDescription.h NSObject IBFrameworkSource Foundation.framework/Headers/NSError.h NSObject IBFrameworkSource Foundation.framework/Headers/NSFileManager.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyValueCoding.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyValueObserving.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyedArchiver.h NSObject IBFrameworkSource Foundation.framework/Headers/NSObject.h NSObject IBFrameworkSource Foundation.framework/Headers/NSObjectScripting.h NSObject IBFrameworkSource Foundation.framework/Headers/NSPortCoder.h NSObject IBFrameworkSource Foundation.framework/Headers/NSRunLoop.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptClassDescription.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptKeyValueCoding.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptObjectSpecifiers.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptWhoseTests.h NSObject IBFrameworkSource Foundation.framework/Headers/NSThread.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURL.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURLConnection.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURLDownload.h 0 IBCocoaTouchFramework com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 YES ../AFCache.xcodeproj 3 117 ================================================ FILE: src/Examples/NSURLRequest.xib ================================================ 800 10F569 788 1038.29 461.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin 117 YES YES com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES YES YES YES IBFilesOwner IBCocoaTouchFramework IBFirstResponder IBCocoaTouchFramework 274 YES 306 {{31, 20}, {257, 43}} 3 MQA 2 NO YES NO IBCocoaTouchFramework NSURLRequest Helvetica 36 16 1 MCAwIDAAA 1 10 1 306 {{20, 71}, {275, 51}} NO YES YES NO IBCocoaTouchFramework NO NO NO 0.0 0.0 NO NO See logs 1 IBCocoaTouchFramework 292 {{31, 130}, {257, 212}} 1 NO IBCocoaTouchFramework {320, 411} 3 MQA IBCocoaTouchFramework YES view 3 imageView 9 YES 0 1 YES -1 File's Owner -2 5 7 8 YES YES -1.CustomClassName -2.CustomClassName 1.IBEditorWindowLastContentRect 1.IBPluginDependency 5.IBPluginDependency 7.IBPluginDependency 8.IBPluginDependency YES NSURLRequestDemoViewController UIResponder {{130, 393}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES YES YES YES 9 YES NSURLRequestDemoViewController UIViewController imageView UIImageView imageView imageView UIImageView IBProjectSource NSURLRequestDemoViewController.h YES NSObject IBFrameworkSource AppKit.framework/Headers/NSAccessibility.h NSObject IBFrameworkSource AppKit.framework/Headers/NSApplication.h NSObject IBFrameworkSource AppKit.framework/Headers/NSApplicationScripting.h NSObject IBFrameworkSource AppKit.framework/Headers/NSColorPanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSControl.h NSObject IBFrameworkSource AppKit.framework/Headers/NSDictionaryController.h NSObject IBFrameworkSource AppKit.framework/Headers/NSDragging.h NSObject IBFrameworkSource AppKit.framework/Headers/NSFontManager.h NSObject IBFrameworkSource AppKit.framework/Headers/NSFontPanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSKeyValueBinding.h NSObject IBFrameworkSource AppKit.framework/Headers/NSMenu.h NSObject IBFrameworkSource AppKit.framework/Headers/NSNibLoading.h NSObject IBFrameworkSource AppKit.framework/Headers/NSOutlineView.h NSObject IBFrameworkSource AppKit.framework/Headers/NSPasteboard.h NSObject IBFrameworkSource AppKit.framework/Headers/NSSavePanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSTableView.h NSObject IBFrameworkSource AppKit.framework/Headers/NSToolbarItem.h NSObject IBFrameworkSource AppKit.framework/Headers/NSView.h NSObject IBFrameworkSource Foundation.framework/Headers/NSArchiver.h NSObject IBFrameworkSource Foundation.framework/Headers/NSClassDescription.h NSObject IBFrameworkSource Foundation.framework/Headers/NSError.h NSObject IBFrameworkSource Foundation.framework/Headers/NSFileManager.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyValueCoding.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyValueObserving.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyedArchiver.h NSObject IBFrameworkSource Foundation.framework/Headers/NSObject.h NSObject IBFrameworkSource Foundation.framework/Headers/NSObjectScripting.h NSObject IBFrameworkSource Foundation.framework/Headers/NSPortCoder.h NSObject IBFrameworkSource Foundation.framework/Headers/NSRunLoop.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptClassDescription.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptKeyValueCoding.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptObjectSpecifiers.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptWhoseTests.h NSObject IBFrameworkSource Foundation.framework/Headers/NSThread.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURL.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURLConnection.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURLDownload.h 0 IBCocoaTouchFramework com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 YES ../AFCache.xcodeproj 3 117 ================================================ FILE: src/Examples/NSURLRequestDemoViewController.h ================================================ // // NSURLRequestDemoViewController.h // AFCache // // Created by Michael Markowski on 25.08.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // #import @interface NSURLRequestDemoViewController : UIViewController { NSMutableData *receivedData; UIImageView *imageView; } @property (nonatomic, retain) NSMutableData *receivedData; @property (nonatomic, retain) IBOutlet UIImageView *imageView; @end ================================================ FILE: src/Examples/NSURLRequestDemoViewController.m ================================================ // // NSURLRequestDemoViewController.m // AFCache // // Created by Michael Markowski on 25.08.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // // This demonstrates how AFCache is involved when using an NSURLConnection #import "NSURLRequestDemoViewController.h" #import "Constants.h" @implementation NSURLRequestDemoViewController @synthesize receivedData, imageView; - (void)viewDidAppear:(BOOL)animated { // Create the request. NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:kDemoURL] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; // create the connection with the request // and start loading the data NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; if (theConnection) { // Create the NSMutableData to hold the received data. // receivedData is an instance variable declared elsewhere. receivedData = [[NSMutableData data] retain]; } else { // Inform the user that the connection failed. } } - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { // This method is called when the server has determined that it // has enough information to create the NSURLResponse. // It can be called multiple times, for example in the case of a // redirect, so each time we reset the data. // receivedData is an instance variable declared elsewhere. [receivedData setLength:0]; } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { // Append the new data to receivedData. // receivedData is an instance variable declared elsewhere. [receivedData appendData:data]; } - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { // release the connection, and the data object [connection release]; // receivedData is declared as a method instance elsewhere [receivedData release]; // inform the user NSLog(@"Connection failed! Error - %@ %@", [error localizedDescription], [[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]); } - (void)connectionDidFinishLoading:(NSURLConnection *)connection { // do something with the data // receivedData is declared as a method instance elsewhere NSLog(@"Succeeded! Received %d bytes of data",[receivedData length]); // release the connection, and the data object [connection release]; UIImage *img = [UIImage imageWithData:receivedData]; imageView.image = img; [receivedData release]; } - (void)dealloc { [imageView release]; [super dealloc]; } @end ================================================ FILE: src/Examples/Packaging.xib ================================================ 800 10F569 788 1038.29 461.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin 117 YES YES com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES YES YES YES IBFilesOwner IBCocoaTouchFramework IBFirstResponder IBCocoaTouchFramework 274 YES 274 {{20, 20}, {158, 235}} 1 MSAxIDEAA YES YES IBCocoaTouchFramework Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 2 IBCocoaTouchFramework 292 {{20, 263}, {240, 128}} IBCocoaTouchFramework 1 YES 292 {{186, 20}, {114, 105}} 1 NO IBCocoaTouchFramework {320, 411} 3 MQA IBCocoaTouchFramework YES view 3 textView 12 imageView 13 webView 14 delegate 15 YES 0 1 YES -1 File's Owner -2 9 10 11 YES YES -1.CustomClassName -2.CustomClassName 1.IBEditorWindowLastContentRect 1.IBPluginDependency 10.IBPluginDependency 11.IBPluginDependency 9.IBPluginDependency YES PackagingDemoController UIResponder {{566, 650}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES YES YES YES 15 YES PackagingDemoController UIViewController YES YES imageView textView webView YES UIImageView UITextView UIWebView YES YES imageView textView webView YES imageView UIImageView textView UITextView webView UIWebView IBProjectSource demo/PackagingDemoController.h PackagingDemoController UIViewController triggerNSURLRequestAction: id triggerNSURLRequestAction: triggerNSURLRequestAction: id IBUserSource YES NSObject IBFrameworkSource AppKit.framework/Headers/NSAccessibility.h NSObject IBFrameworkSource AppKit.framework/Headers/NSApplication.h NSObject IBFrameworkSource AppKit.framework/Headers/NSApplicationScripting.h NSObject IBFrameworkSource AppKit.framework/Headers/NSColorPanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSControl.h NSObject IBFrameworkSource AppKit.framework/Headers/NSDictionaryController.h NSObject IBFrameworkSource AppKit.framework/Headers/NSDragging.h NSObject IBFrameworkSource AppKit.framework/Headers/NSFontManager.h NSObject IBFrameworkSource AppKit.framework/Headers/NSFontPanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSKeyValueBinding.h NSObject IBFrameworkSource AppKit.framework/Headers/NSMenu.h NSObject IBFrameworkSource AppKit.framework/Headers/NSNibLoading.h NSObject IBFrameworkSource AppKit.framework/Headers/NSOutlineView.h NSObject IBFrameworkSource AppKit.framework/Headers/NSPasteboard.h NSObject IBFrameworkSource AppKit.framework/Headers/NSSavePanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSTableView.h NSObject IBFrameworkSource AppKit.framework/Headers/NSToolbarItem.h NSObject IBFrameworkSource AppKit.framework/Headers/NSView.h NSObject IBFrameworkSource Foundation.framework/Headers/NSArchiver.h NSObject IBFrameworkSource Foundation.framework/Headers/NSClassDescription.h NSObject IBFrameworkSource Foundation.framework/Headers/NSError.h NSObject IBFrameworkSource Foundation.framework/Headers/NSFileManager.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyValueCoding.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyValueObserving.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyedArchiver.h NSObject IBFrameworkSource Foundation.framework/Headers/NSObject.h NSObject IBFrameworkSource Foundation.framework/Headers/NSObjectScripting.h NSObject IBFrameworkSource Foundation.framework/Headers/NSPortCoder.h NSObject IBFrameworkSource Foundation.framework/Headers/NSRunLoop.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptClassDescription.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptKeyValueCoding.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptObjectSpecifiers.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptWhoseTests.h NSObject IBFrameworkSource Foundation.framework/Headers/NSThread.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURL.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURLConnection.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURLDownload.h 0 IBCocoaTouchFramework com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 YES ../AFCache.xcodeproj 3 117 ================================================ FILE: src/Examples/PackagingDemoController.h ================================================ // // DemoViewController.h // Demo // // Created by Michael Markowski on 07.07.10. // Copyright Artifacts 2010. All rights reserved. // #import #import "AFCache+Packaging.h" @interface PackagingDemoController : UIViewController { UITextView *textView; UIWebView *webView; UIImageView *imageView; } @property (nonatomic, retain) IBOutlet UITextView *textView; @property (nonatomic, retain) IBOutlet UIWebView *webView; @property (nonatomic, retain) IBOutlet UIImageView *imageView; - (void)loadContent; @end ================================================ FILE: src/Examples/PackagingDemoController.m ================================================ // // DemoViewController.m // Demo // // Created by Michael Markowski on 07.07.10. // Copyright Artifacts 2010. All rights reserved. // #import "PackagingDemoController.h" #import "Constants.h" @implementation PackagingDemoController @synthesize textView, webView, imageView; - (void)viewDidAppear:(BOOL)animated { // load an image ansychronously textView.text = kDemoURL; [[AFCache sharedInstance] requestPackageArchive:[NSURL URLWithString:kPackageDemoURL] delegate:self]; } - (void)connectionDidFail:(AFCacheableItem *)cacheableItem { textView.text = [cacheableItem.error description]; NSLog(@"cache request did fail for URL: %@", [cacheableItem.url absoluteString]); } - (void)connectionDidFinish:(AFCacheableItem *)cacheableItem { textView.text = [cacheableItem description]; UIImage *img = [UIImage imageWithData:cacheableItem.data]; self.imageView.image = img; NSLog(@"cache loaded resource for URL: %@", [cacheableItem.url absoluteString]); } - (void) packageArchiveDidReceiveData: (AFCacheableItem *) cacheableItem { float totalSize = cacheableItem.info.contentLength; float currentSize = [cacheableItem.data length]; float percentage = currentSize / (totalSize/100); // [self.progressView setProgress:currentSize / totalSize]; if (percentage < 100) { NSLog(@"%.0f%% loaded", percentage); } } - (void) packageArchiveDidFinishLoading: (AFCacheableItem *) cacheableItem { NSLog(@"Loaded package. Extracting..."); [[AFCache sharedInstance] consumePackageArchive:cacheableItem preservePackageInfo:YES]; } - (void) packageArchiveDidFinishExtracting: (AFCacheableItem *) cacheableItem { NSLog(@"Extracted package."); [[AFCache sharedInstance] setOffline:YES]; NSLog(@"Setting cache into offline mode."); [self loadContent]; } - (void) packageArchiveDidFailLoading: (AFCacheableItem *) cacheableItem { NSLog(@"FAILED loading package. No network connection?"); [self loadContent]; } - (void)loadContent { [[AFCache sharedInstance] cachedObjectForURL:[NSURL URLWithString:kDemoURL] delegate:self options:0]; // load request in webview, to demonstrate that webview is asking the cache for every url. NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:kWebDemoURL]]; [webView loadRequest:request]; } - (void)dealloc { [imageView release]; [textView release]; [webView release]; [super dealloc]; } @end ================================================ FILE: src/Examples/main.m ================================================ // // main.m // Demo // // Created by Michael Markowski on 07.07.10. // Copyright Artifacts 2010. All rights reserved. // #import int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, nil); [pool release]; return retVal; } ================================================ FILE: src/OSX/AFCache-Info.plist ================================================ CFBundleDevelopmentRegion English CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile CFBundleIdentifier de.artifacts.${PRODUCT_NAME:rfc1034identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 NSHumanReadableCopyright Copyright © 2011 Artifacts - Fine Software Development. All rights reserved. NSPrincipalClass ================================================ FILE: src/OSX/AFCache-Prefix.pch ================================================ // // Prefix header for all source files of the 'AFCache' target in the 'AFCache' project // #ifdef __OBJC__ #import #endif ================================================ FILE: src/OSX/afcpkg_main.h ================================================ // // afcpkg_main.h // AFCache // // Created by Michael Markowski on 22.07.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // #import @interface afcpkg_main : NSObject - (void)createPackageWithArgs:(NSUserDefaults*)args; @end ================================================ FILE: src/OSX/afcpkg_main.m ================================================ // // afcpkg_main.m // AFCache // // Created by Michael Markowski on 22.07.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // #import "afcpkg_main.h" #import "AFCache.h" #import "AFCache+Packaging.h" #import "AFCacheableItem+Packaging.h" #import "AFCachePackageCreator.h" #import #pragma mark - #pragma mark main /* ================================================================================================ * Main * ================================================================================================ */ int main(int argc, char *argv[]) { NSUserDefaults *args = [NSUserDefaults standardUserDefaults]; afcpkg_main *main = [[afcpkg_main alloc] init]; [main createPackageWithArgs:args]; return 0; } @implementation afcpkg_main //@synthesize folder, baseURL, maxAge, lastModifiedOffset; #pragma mark - #pragma mark commandline handling /* ================================================================================================ * Create AFCache Package with given commandline args * ================================================================================================ */ - (void)createPackageWithArgs:(NSUserDefaults*)args { AFCachePackageCreator *packager = [[AFCachePackageCreator alloc] init]; NSMutableDictionary *options = [NSMutableDictionary dictionary]; NSError *error = nil; // folder containing resources [options setValue:[args stringForKey:@"folder"] forKey:kPackagerOptionResourcesFolder]; // base url, e.g. http://www.foo.bar (WITHOUT trailing slash) [options setValue:[args stringForKey:@"baseurl"] forKey:kPackagerOptionBaseURL]; // max-age in seconds [options setValue:[args stringForKey:@"maxage"] forKey:kPackagerOptionMaxAge]; // Maximum filesize of a cacheable item. Default is unlimited. [options setValue:[NSNumber numberWithDouble:[args doubleForKey:@"maxItemFileSize"]] forKey:kPackagerOptionMaxItemFileSize]; // will substract n seconds from file's lastmodfied date [options setValue:[NSNumber numberWithDouble:[args doubleForKey:@"lastmodifiedminus"]] forKey:kPackagerOptionLastModifiedMinus]; // will add n seconds to file's lastmodfied date [options setValue:[NSNumber numberWithDouble:[args doubleForKey:@"lastmodifiedplus"]] forKey:kPackagerOptionLastModifiedPlus]; // write manifest file in json format (just for testing purposes) [options setValue:[args stringForKey:@"json"] forKey:kPackagerOptionOutputFormatJSON]; // include all files. By default, files starting with a dot are excluded. [options setValue:[args stringForKey:@"a"] forKey:kPackagerOptionIncludeAllFiles]; // output filename [options setValue:[args stringForKey:@"outfile"] forKey:kPackagerOptionOutputFilename]; // Folder containing arbitrary user data (will be accesible via userDataPathForPackageArchiveKey: in AFCache+Packaging.m [options setValue:[args stringForKey:@"userdata"] forKey:kPackagerOptionUserDataFolder]; // Key under which userdata can be accessed. Default is no key. [options setValue:[args stringForKey:@"userdatakey"] forKey:kPackagerOptionUserDataKey]; // Create ZIP archive BOOL showHelp = ( 0 == [[options valueForKey: kPackagerOptionBaseURL] length] ); @try { if (showHelp==YES) { printf("\n"); printf("Usage: afcpkg [-outfile] [-maxage] [-baseurl] [-file] [-folder] [-json] [-h] [-a] [-outfile] [-maxItemFileSize] [-userdata]\n"); printf("\n"); printf("\t-maxage \t\tmax-age in seconds\n"); printf("\t-baseurl \t\tbase url, e.g. http://www.foo.bar (WITHOUT trailing slash)\n"); printf("\t-lastmodifiedplus \tadd n seconds to file's lastmodfied date\n"); printf("\t-lastmodifiedminus \tsubstract n seconds from file's lastmodfied date\n"); printf("\t-folder \t\tfolder containing resources\n"); printf("\t-json \t\t\twrite manifest file in json format (just for testing purposes)\n"); printf("\t-h \t\t\tdisplay this help output\n"); printf("\t-a \t\t\tinclude all files. By default, files starting with a dot are excluded.\n"); printf("\t-outfile \t\t\toutput filename\n"); printf("\t-maxItemFileSize \t\t\tMaximum filesize of a cacheable item. Default is unlimited.\n"); printf("\t-userdata \t\t\tFolder containing arbitrary user data (will be accesible via userDataPathForPackageArchiveKey: in AFCache+Packaging.m\n"); printf("\t-userdatakey \t\t\tKey under which userdata can be accessed. Default is no key (nil).\n"); printf("\n"); exit(0); } else { if (NO == [packager createPackageWithOptions:options error:&error]) { [NSException raise:@"Package creation error" format:@"Reason: %@", [error localizedDescription]]; } } } @catch (NSException * e) { NSLog(@"afcpkg error: %@", [e description]); printf("Error. See log for details."); } } @end ================================================ FILE: src/iOS/AFCache-iOS-Prefix.pch ================================================ // // Prefix header for all source files of the 'AFCache-iOS' target in the 'AFCache-iOS' project // #ifdef __OBJC__ #import #endif ================================================ FILE: src/python/afcpkg.py ================================================ #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2008 Artifacts - Fine Software Development # http://www.artifacts.de # Author: Martin Borho (martin@borho.net) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import re import os import sys import time import logging import mimetypes import fnmatch from urlparse import urlparse from optparse import OptionParser from zipfile import ZipFile rfc1123_format = '%a, %d %b %Y %H:%M:%S GMT+00:00' # add mimetypes mimetypes.add_type('application/json', '.json', strict=True) class AFCachePackager(object): def __init__(self, **kwargs): self.maxage = kwargs.get('maxage') self.baseurl = kwargs.get('baseurl') if not self.baseurl: self.baseurl = 'afcpkg://localhost' self.lastmodfile = kwargs.get('lastmodfile') self.lastmodplus = kwargs.get('lastmodplus') self.lastmodminus = kwargs.get('lastmodminus') self.folder = kwargs.get('folder') self.include_all = kwargs.get('include_all') self.outfile = kwargs.get('outfile') if not self.outfile: self.outfile = 'afcache-archive.zip' self.max_size = kwargs.get('max_size') self.excludes = kwargs.get('excludes', []) self.mime = kwargs.get('mime') self.errors = [] self.logger = kwargs.get('logger',logging.getLogger(__file__)) self._check_input() def _check_input(self): if not self.folder: self.errors.append('import-folder (--folder) is missing') elif not os.path.isdir(self.folder): self.errors.append('import-folder does not exists') if not self.maxage: self.errors.append('maxage is missing') def _get_host(self, baseurl): p = urlparse(baseurl) if p.hostname: return p.hostname else: self.errors.append('baseurl invalid') return None def build_zipcache(self): manifest = [] hostname = self._get_host(self.baseurl) if self.errors: return None try: zip = ZipFile(self.outfile, 'w') except IOError, e: self.logger.error('exiting: creation of zipfile failed!') return None else: for dirpath, dirnames, filenames in os.walk(self.folder): # skip empty dirs if not filenames: continue for name in filenames: path = os.path.join(dirpath, name) # skip hidden files if if not self.include_all: if name.startswith('.') or path.find('/.') > -1: self.logger.info("skipping "+path) continue # skip big files if if self.max_size and (os.path.getsize(path) > self.max_size): self.logger.info("skipping big file "+path) continue # exclude paths if if self.excludes: exclude_file = None for ex_filter in self.excludes: if fnmatch.fnmatch(path, ex_filter): exclude_file = True self.logger.info("excluded "+path) break if exclude_file: continue # detect mime-type mime_type = '' if self.mime: mime_tuple = mimetypes.guess_type(path, False) if mime_tuple[0]: mime_type = mime_tuple[0] else: self.logger.warning("mime-type unknown: "+path) # handle lastmodified if self.lastmodfile: lastmod = os.path.getmtime(os.path.join(dirpath, name)) else: lastmod = time.time() if self.lastmodplus: lastmod += self.lastmodplus elif self.lastmodminus: lastmod -= self.lastmodminus # handle path forms rel_path = os.path.join(dirpath.replace(os.path.normpath(self.folder),''),name) exported_path = hostname+rel_path # add data self.logger.info("adding "+ exported_path) zip.write(path, exported_path) # add manifest line last_mod_date = time.strftime(rfc1123_format,time.gmtime(lastmod)) expire_date = time.strftime(rfc1123_format,time.gmtime(lastmod+self.maxage)) manifest_line = '%s ; %s ; %s' % (self.baseurl+rel_path, last_mod_date, expire_date) # add mime type if self.mime: manifest_line += ' ; '+mime_type manifest.append(manifest_line) # add manifest to zip self.logger.info("adding manifest") zip.writestr("manifest.afcache", "\n".join(manifest)) return True def main(): logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(levelname)-2s %(message)s') logger = logging.getLogger(__file__) usage = "Usage: %prog [options]" parser = OptionParser(usage) parser.add_option("--maxage", dest="maxage", type="int", help="max-age in seconds") parser.add_option("--baseurl", dest="baseurl", help="base url, e.g. http://www.foo.bar (WITHOUT trailig slash)") parser.add_option("--lastmodifiedfile", dest="lastmodfile", action="store_true", help="use lastmodified from file instead of now") parser.add_option("--lastmodifiedplus", dest="lastmodplus", type="int", help="add n seconds to file's lastmodfied date") parser.add_option("--lastmodifiedminus", dest="lastmodminus", type="int", help="substract n seconds from file's lastmodfied date") parser.add_option("--folder", dest="folder", help="folder containing resources") parser.add_option("-a", dest="include_all", action="store_true", help="include all files. By default, files starting with a dot are excluded.") parser.add_option("--outfile", dest="outfile", help="Output filename. Default: afcache-archive.zip") parser.add_option("--maxItemFileSize", dest="max_size", type="int", help="Maximum filesize of a cacheable item.") parser.add_option("--exclude", dest="excludes",action="append", help="Regexp filter for filepaths. Add one --exclude for every pattern.") parser.add_option("--mime", dest="mime", action="store_true", help="add file mime types to manifest.afcache") (options, args) = parser.parse_args() packager = AFCachePackager( maxage=options.maxage, baseurl=options.baseurl, lastmodfile=options.lastmodfile, lastmodplus=options.lastmodplus, lastmodminus=options.lastmodminus, folder=options.folder, include_all=options.include_all, outfile=options.outfile, max_size=options.max_size, excludes=options.excludes, mime=options.mime, logger=logger ) packager.build_zipcache() if packager.errors: print "Error: "+"\nError: ".join(packager.errors) if __name__ == "__main__": main() ================================================ FILE: src/shared/AFCache+DeprecatedAPI.h ================================================ // // AFCache+DeprecatedAPI.h // AFCache // // Created by Lars Blumberg on 29.08.14. // Copyright (c) 2014 Artifacts - Fine Software Development. All rights reserved. // #import #import @interface AFCache (DeprecatedAPI) - (AFCacheableItem *)cachedObjectForURLSynchroneous: (NSURL *) url DEPRECATED_MSG_ATTRIBUTE("Use cachedObjectForURLSynchronous:"); - (AFCacheableItem *)cachedObjectForURLSynchroneous:(NSURL *)url options: (int)options DEPRECATED_MSG_ATTRIBUTE("Use cachedObjectForURLSynchronous:options:"); @end ================================================ FILE: src/shared/AFCache+DeprecatedAPI.m ================================================ // // AFCache+DeprecatedAPI.m // AFCache // // Created by Lars Blumberg on 29.08.14. // Copyright (c) 2014 Artifacts - Fine Software Development. All rights reserved. // #import "AFCache+DeprecatedAPI.h" @implementation AFCache (DeprecatedAPI) - (AFCacheableItem *)cachedObjectForURLSynchroneous: (NSURL *) url { return [self cachedObjectForURLSynchronous:url]; } - (AFCacheableItem *)cachedObjectForURLSynchroneous:(NSURL *)url options: (int)options { return [self cachedObjectForURLSynchronous:url options:options]; } @end ================================================ FILE: src/shared/AFCache+FileAttributes.h ================================================ // // AFCache+FileAttributes.h // AFCache // // Created by Sebastian Grimme on 17.05.16. // Copyright © 2016 Artifacts - Fine Software Development. All rights reserved. // #import @interface AFCache (FileAttributes) - (uint64_t)setContentLengthForFileAtPath:(NSString*)filePath; @end ================================================ FILE: src/shared/AFCache+FileAttributes.m ================================================ // // AFCache+FileAttributes.m // AFCache // // Created by Sebastian Grimme on 17.05.16. // Copyright © 2016 Artifacts - Fine Software Development. All rights reserved. // #import "AFCache+FileAttributes.h" #import "AFCacheableItem+FileAttributes.h" #import "AFCache+PrivateAPI.h" #import "AFCache_Logging.h" #include @implementation AFCache (FileAttributes) - (uint64_t)setContentLengthForFileAtPath:(NSString*)filePath { NSError* err = nil; NSDictionary* attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:&err]; if (err) { AFLog(@"Could not get file attributes for %@", filename); return 0; } uint64_t fileSize = [attrs fileSize]; if (0 != setxattr(filePath.fileSystemRepresentation, kAFCacheContentLengthFileAttribute, &fileSize, sizeof(fileSize), 0, 0)) { AFLog(@"Could not set content length for file %@", filename); return 0; } return fileSize; } @end ================================================ FILE: src/shared/AFCache+Mimetypes.h ================================================ // // AFCache+Mimetypes.h // AFCache // // Created by Michael Markowski on 13.08.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // #import #import "AFCache.h" @interface AFCache (MimeType) - (void)initMimeTypes; @end ================================================ FILE: src/shared/AFCache+Mimetypes.m ================================================ // // AFCache+Mimetypes.m // AFCache // // Created by Michael Markowski on 13.08.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // #import "AFCache+Mimetypes.h" @implementation AFCache (MimeType) // TODO: This method should not be realized within a category as this category is private anyway - (void)initMimeTypes { // TODO: Assign to _suffixToMimeTypeMap as this is a init method (as soon as this method goes to main implementation file) self.suffixToMimeTypeMap = [NSDictionary dictionaryWithObjectsAndKeys: @"application/msword", @".doc", @"application/msword", @".dot", @"application/vnd.ms-excel", @".xls", @"application/vnd.ms-excel", @".xlt", @"text/comma-separated-values", @".csv", @"text/tab-separated-values", @".tab", @"text/tab-separated-values", @".tsv", @"application/vnd.ms-powerpoint", @".ppt", @"application/vnd.ms-project", @".mpp", @"application/vnd.ms-works", @".wps", @"application/vnd.ms-works", @".wdb", @"application/x-visio", @".vsd", @"application/x-visio", @".vst", @"application/x-visio", @".vsw", @"application/wordperfect", @".wpd", @"application/wordperfect", @".wp5", @"application/wordperfect", @".wp6", @"application/rtf", @".rtf", @"text/plain", @".txt", @"text/plain", @".text", @"text/html", @".html", @"text/html", @".htm", @"application/hta", @".hta", @"message/rfc822", @".mime", @"text/xml", @".xml", @"text/xml", @".xsl", @"text/xml", @".xslt", @"application/xhtml+xml", @".html", @"application/xhtml+xml", @".xhtml", @"application/xml-dtd", @".dtd", @"application/xml-external-parsed-entity", @".xml", @"text/sgml", @".sgm", @"text/sgml", @".sgml", @"text/css", @".css", @"text/javascript", @".js", @"application/x-javascript", @".ls", @"image/gif", @".gif", @"image/jpeg", @".jpg", @"image/jpeg", @".jpeg", @"image/jpeg", @".jpe", @"image/png", @".png", @"image/tiff", @".tif", @"image/tiff", @".tiff", @"image/bmp", @".bmp", @"image/x-pict", @".pict", @"image/x-icon", @".ico", @"image/x-icon", @".icl", @"image/vnd.dwg", @".dwg", @"audio/x-wav", @".wav", @"audio/x-mpeg", @".mpa", @"audio/x-mpeg", @".abs", @"audio/x-mpeg", @".mpega", @"audio/x-mpeg", @".mp3", @"audio/x-mpeg-2", @".mp2a", @"audio/x-mpeg-2", @".mpa2", @"application/x-pn-realaudio", @".ra", @"application/x-pn-realaudio", @".ram", @"application/vnd.rn-realmedia", @".rm", @"audio/x-aiff", @".aif", @"audio/x-aiff", @".aiff", @"audio/x-aiff", @".aifc", @"audio/x-midi", @".mid", @"audio/x-midi", @".midi", @"video/mpeg", @".mpeg", @"video/mpeg", @".mpg", @"video/mpeg", @".mpe", @"video/mpeg-2", @".mpv2", @"video/mpeg-2", @".mp2v", @"video/quicktime", @".mov", @"video/quicktime", @".moov", @"video/x-msvideo", @".avi", @"application/pdf", @".pdf", @"application/postscript", @".ps", @"application/postscript", @".ai", @"application/postscript", @".eps", @"application/zip", @".zip", @"application/x-compressed", @".tar.gz", @"application/x-compressed", @".tgz", @"application/x-gzip", @".gz", @"application/x-gzip", @".gzip", @"application/x-bzip2", @".bz2", @"application/x-stuffit", @".sit", @"application/x-stuffit", @".sea", @"application/mac-binhex40", @".hqx", @"application/octet-stream", @".bin", @"application/octet-stream", @".uu", @"application/octet-stream", @".exe", @"application/vnd.sun.xml.writer", @".sxw", @"application/vnd.sun.xml.writer", @".sxg", @"application/vnd.sun.xml.writer.template", @".sxw", @"application/vnd.sun.xml.calc", @".sxc", @"application/vnd.sun.xml.calc.template", @".stc", @"application/vnd.sun.xml.draw", @".sxd", @"application/vnd.sun.xml.draw", @".std", @"application/vnd.sun.xml.impress", @".sxi", @"application/vnd.sun.xml.impress", @".sti", @"application/vnd.stardivision.writer", @".sdw", @"application/vnd.stardivision.writer", @".sgl", @"application/vnd.stardivision.calc", @".sdc", @"image/svg+xml", @".svg", nil]; } @end ================================================ FILE: src/shared/AFCache+Packaging.h ================================================ // // AFCache+Packaging.h // AFCache // // Created by Michael Markowski on 13.08.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // #import #import "AFCache.h" #import "AFPackageInfo.h" // TODO: Is this a real category? It relays on the existence of properties (e.g. packageArchiveQueue) that are only used by this category @interface AFCache (Packaging) - (BOOL)importCacheableItem:(AFCacheableItem*)cacheableItem withData:(NSData*)theData; - (BOOL)importCacheableItem:(AFCacheableItem*)cacheableItem dataWithFileAtURL:(NSURL*)URL; - (AFCacheableItem*)importObjectForURL:(NSURL*)url data:(NSData*)data; - (AFCacheableItem*)importObjectForURL:(NSURL*)url dataWithFileAtURL:(NSURL*)URL; - (AFCacheableItem *)requestPackageArchive:(NSURL*)url delegate:(id)aDelegate; - (AFCacheableItem *)requestPackageArchive:(NSURL*)url delegate:(id)aDelegate username:(NSString*)username password:(NSString*)password; - (void)packageArchiveDidFinishLoading: (AFCacheableItem *) cacheableItem; - (NSString*)userDataPathForPackageArchiveKey:(NSString*)archiveKey; - (AFPackageInfo*)packageInfoForURL:(NSURL*)url; // wipe out a cachable item completely - (void)purgeCacheableItemForURL:(NSURL*)url; // remove an imported package zip - (void)purgePackageArchiveForURL:(NSURL*)url; // announce files residing in the urlcachestore folder by reading the cache manifest file // this method assumes that the files already have been extracted into the urlcachestore folder - (AFPackageInfo*)newPackageInfoByImportingCacheManifestAtPath:(NSString*)manifestPath intoCacheStoreWithPath:(NSString*)urlCacheStorePath withPackageURL:(NSURL*)packageURL; - (void)storeCacheInfo:(NSDictionary*)dictionary; // Deprecated methods: #pragma mark - #pragma mark Deprecated methods // Deprecated. Use consumePackageArchive:preservePackageInfo: instead - (void)consumePackageArchive:(AFCacheableItem*)cacheableItem DEPRECATED_ATTRIBUTE; - (void)consumePackageArchive:(AFCacheableItem*)cacheableItem preservePackageInfo:(BOOL)preservePackageInfo; - (void)consumePackageArchive:(AFCacheableItem*)cacheableItem userData:(NSDictionary*)userData preservePackageInfo:(BOOL)preservePackageInfo; @end ================================================ FILE: src/shared/AFCache+Packaging.m ================================================ // // AFCache+Packaging.m // AFCache // // Created by Michael Markowski on 13.08.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // #import "AFCache+PrivateAPI.h" #import "AFCache+FileAttributes.h" #import "AFCacheableItem+Packaging.h" #import "AFCacheableItem+FileAttributes.h" #import "ZipArchive.h" #import "DateParser.h" #import "AFPackageInfo.h" #import "AFCache+Packaging.h" #import "AFCache_Logging.h" @implementation AFCache (Packaging) enum ManifestKeys { ManifestKeyURL = 0, ManifestKeyLastModified = 1, ManifestKeyExpires = 2, ManifestKeyMimeType = 3, ManifestKeyFilename = 4, }; - (AFCacheableItem *)requestPackageArchive: (NSURL *) url delegate: (id) aDelegate { AFCacheableItem *item = [self cachedObjectForURL:url delegate:aDelegate selector:@selector(packageArchiveDidFinishLoading:) didFailSelector:@selector(packageArchiveDidFailLoading:) options:kAFCacheIsPackageArchive | kAFCacheRevalidateEntry userData:nil username:nil password:nil request:nil]; return item; } - (AFCacheableItem *)requestPackageArchive: (NSURL *) url delegate: (id) aDelegate username: (NSString*) username password: (NSString*) password { AFCacheableItem *item = [self cachedObjectForURL: url delegate: aDelegate selector: @selector(packageArchiveDidFinishLoading:) didFailSelector: @selector(packageArchiveDidFailLoading:) options: kAFCacheIsPackageArchive | kAFCacheRevalidateEntry userData: nil username: username password: password request:nil]; return item; } - (void) packageArchiveDidFinishLoading: (AFCacheableItem *) cacheableItem { if ([cacheableItem.delegate respondsToSelector:@selector(packageArchiveDidFinishLoading:)]) { [cacheableItem.delegate performSelector:@selector(packageArchiveDidFinishLoading:) withObject:cacheableItem]; } } /* * Consume (unzip an archive) and optionally keep track of the included items. * Preserve package info is given as an argument to the unzip thread. * If YES, AFCache remembers which items have been imported for this package URL. * Package information can be accessed later via packageInfoForURL: */ - (void)consumePackageArchive:(AFCacheableItem*)cacheableItem preservePackageInfo:(BOOL)preservePackageInfo { [self consumePackageArchive:cacheableItem userData:nil preservePackageInfo:preservePackageInfo]; } - (void)consumePackageArchive:(AFCacheableItem*)cacheableItem userData:(NSDictionary*)userData preservePackageInfo:(BOOL)preservePackageInfo { if (cacheableItem.info.packageArchiveStatus == kAFCachePackageArchiveStatusConsumed) { // ZIP file is already consumed [self performArchiveReadyWithItem:cacheableItem]; return; } NSString *urlCacheStorePath = self.dataPath; NSString *pathToZip = [[AFCache sharedInstance] fullPathForCacheableItem:cacheableItem]; NSDictionary* arguments = @{ @"pathToZip" : pathToZip, @"cacheableItem" : cacheableItem, @"urlCacheStorePath" : urlCacheStorePath, @"preservePackageInfo" : @(preservePackageInfo), @"userData" : userData}; [[self packageArchiveQueue] addOperation:[[NSInvocationOperation alloc] initWithTarget:self selector:@selector(unzipWithArguments:) object:arguments]]; } - (void)unzipWithArguments:(NSDictionary*)arguments { @autoreleasepool { AFLog(@"starting to unzip archive"); // get arguments from dictionary NSString* pathToZip = arguments[@"pathToZip"]; AFCacheableItem* cacheableItem = arguments[@"cacheableItem"]; __unsafe_unretained NSString* urlCacheStorePath = arguments[@"urlCacheStorePath"]; BOOL preservePackageInfo = [arguments[@"preservePackageInfo"] boolValue]; NSDictionary *userData = arguments[@"userData"]; ZipArchive *zip = [[ZipArchive alloc] init]; BOOL success = [zip UnzipOpenFile:pathToZip]; [zip UnzipFileTo:[pathToZip stringByDeletingLastPathComponent] overWrite:YES]; [zip UnzipCloseFile]; if (success) { __unsafe_unretained NSString *pathToManifest = [NSString stringWithFormat:@"%@/%@", urlCacheStorePath, @"manifest.afcache"]; __unsafe_unretained AFPackageInfo *packageInfo; __unsafe_unretained NSURL *itemURL = cacheableItem.url; NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:@selector(newPackageInfoByImportingCacheManifestAtPath:intoCacheStoreWithPath:withPackageURL:)]]; [inv setTarget:self]; [inv setSelector:@selector(newPackageInfoByImportingCacheManifestAtPath:intoCacheStoreWithPath:withPackageURL:)]; // if you have arguments, set them up here // starting at 2, since 0 is the target and 1 is the selector [inv setArgument:&pathToManifest atIndex:2]; [inv setArgument:&urlCacheStorePath atIndex:3]; [inv setArgument:&itemURL atIndex:4]; [inv performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:YES]; [inv getReturnValue:&packageInfo]; // store information about the imported items if (preservePackageInfo) { [packageInfo.userData addEntriesFromDictionary:userData]; [self.packageInfos setObject:packageInfo forKey:[cacheableItem.url absoluteString]]; } else { NSError *error = nil; [[NSFileManager defaultManager] removeItemAtPath:pathToZip error:&error]; } if (((id)cacheableItem.delegate) == self) { NSAssert(false, @"you may not assign the AFCache singleton as a delegate."); } [self performSelectorOnMainThread:@selector(performArchiveReadyWithItem:) withObject:cacheableItem waitUntilDone:YES]; [self performSelectorOnMainThread:@selector(archive) withObject:nil waitUntilDone:YES]; AFLog(@"finished unzipping archive"); } else { AFLog(@"Unzipping failed. Broken archive?"); [self performSelectorOnMainThread:@selector(performUnarchivingFailedWithItem:) withObject:cacheableItem waitUntilDone:YES]; } } } - (AFPackageInfo*)newPackageInfoByImportingCacheManifestAtPath:(NSString*)manifestPath intoCacheStoreWithPath:(NSString*)urlCacheStorePath withPackageURL:(NSURL*)packageURL { NSError *error = nil; AFCacheableItemInfo *info = nil; NSString *URL = nil; NSString *lastModified = nil; NSString *expires = nil; NSString *mimeType = nil; NSString *filename = nil; int line = 0; // create a package info object for this package // that enables the cache to keep track of items that have been included in a package AFPackageInfo *packageInfo = [[AFPackageInfo alloc] init]; packageInfo.packageURL = packageURL; NSMutableArray *resourceURLs = [[NSMutableArray alloc] init]; //NSString *pathToMetaFolder = [NSString stringWithFormat:@"%@/%@", urlCacheStorePath, @".userdata"]; NSString *manifest = [NSString stringWithContentsOfFile:manifestPath encoding:NSASCIIStringEncoding error:&error]; NSArray *entries = [manifest componentsSeparatedByString:@"\n"]; NSMutableDictionary* cacheInfoDictionary = [NSMutableDictionary dictionary]; DateParser* dateParser = [[DateParser alloc] init]; for (NSString *entry in entries) { line++; if ([entry length] == 0) { continue; } NSArray *values = [entry componentsSeparatedByString:@" ; "]; if ([values count] == 0) continue; if ([values count] < 5) { NSArray *keyval = [entry componentsSeparatedByString:@" = "]; if ([keyval count] == 2) { NSString *key_ = [keyval objectAtIndex:0]; NSString *val_ = [keyval objectAtIndex:1]; if ([@"baseURL" isEqualToString:key_]) { packageInfo.baseURL = [NSURL URLWithString:val_]; } } else { NSLog(@"Invalid entry in manifest in line %d: %@", line, entry); } continue; } info = [[AFCacheableItemInfo alloc] init]; // parse url URL = [values objectAtIndex:ManifestKeyURL]; // parse last-modified lastModified = [values objectAtIndex:ManifestKeyLastModified]; info.lastModified = [dateParser gh_parseHTTP:lastModified]; // parse expires expires = [values objectAtIndex:ManifestKeyExpires]; info.expireDate = [dateParser gh_parseHTTP:expires]; mimeType = [values objectAtIndex:ManifestKeyMimeType]; if( 0 == [mimeType length] || [mimeType isEqualToString:@"NULL"] ) { mimeType = nil; } else { info.mimeType = mimeType; } filename = [values objectAtIndex:ManifestKeyFilename]; if ([filename length] > 0 && ![filename isEqualToString:@"NULL"]) { info.filename = filename; } else { NSLog(@"No filename given for entry in line %d: %@", line, entry); } uint64_t contentLength = [self setContentLengthForFileAtPath:[urlCacheStorePath stringByAppendingPathComponent: filename]]; info.contentLength = contentLength; #if MAINTAINER_WARNINGS #warning BK: textEncodingName always nil here #endif info.response = [[NSURLResponse alloc] initWithURL: [NSURL URLWithString: URL] MIMEType:mimeType expectedContentLength: contentLength textEncodingName: nil]; [resourceURLs addObject:URL]; [cacheInfoDictionary setObject:info forKey:URL]; } packageInfo.resourceURLs = [NSArray arrayWithArray:resourceURLs]; // import generated cacheInfos in to the AFCache info store [self storeCacheInfo:cacheInfoDictionary]; return packageInfo; } - (void)storeCacheInfo:(NSDictionary*)dictionary { @synchronized(self) { for (NSString* key in dictionary) { AFCacheableItemInfo* info = [dictionary objectForKey:key]; [self.cachedItemInfos setObject:info forKey:key]; } } } #pragma mark serialization methods - (void)performArchiveReadyWithItem:(AFCacheableItem*)cacheableItem { cacheableItem.info.packageArchiveStatus = kAFCachePackageArchiveStatusConsumed; } - (void)performUnarchivingFailedWithItem:(AFCacheableItem*)cacheableItem { cacheableItem.info.packageArchiveStatus = kAFCachePackageArchiveStatusUnarchivingFailed; } #pragma mark - import // import and optionally overwrite a cacheableitem. might fail if a download with the very same url is in progress. - (BOOL)importCacheableItem:(AFCacheableItem*)cacheableItem withData:(NSData*)theData { if (cacheableItem == nil || [self isQueuedOrDownloadingURL:cacheableItem.url]) { return NO; } [cacheableItem setDataAndFile:theData]; [self.cachedItemInfos setObject:cacheableItem.info forKey:[cacheableItem.url absoluteString]]; [self archive]; return YES; } - (BOOL)importCacheableItem:(AFCacheableItem*)cacheableItem dataWithFileAtURL:(NSURL *)URL { if (cacheableItem == nil || [self isQueuedOrDownloadingURL:cacheableItem.url]) { return NO; } NSString *fullPathForCacheableItem = [self fullPathForCacheableItem:cacheableItem]; NSError *error = nil; BOOL didMoveItemAtPath = [[NSFileManager defaultManager] moveItemAtPath:URL.path toPath:fullPathForCacheableItem error:&error]; if (!didMoveItemAtPath) { return NO; } NSData *data = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:fullPathForCacheableItem] options:NSDataReadingMappedIfSafe error:nil]; cacheableItem.data = data; cacheableItem.info.contentLength = [data length]; [self.cachedItemInfos setObject:cacheableItem.info forKey:[cacheableItem.url absoluteString]]; [self archive]; return YES; } - (AFCacheableItem *)importObjectForURL:(NSURL *)url data:(NSData *)data { AFCacheableItem *cachedItem = [self cacheableItemFromCacheStore:url]; if (cachedItem) { return cachedItem; } else { AFCacheableItem *item = [[AFCacheableItem alloc] initWithURL:url lastModified:[NSDate date] expireDate:nil]; [self importCacheableItem:item withData:data]; return item; } } - (AFCacheableItem *)importObjectForURL:(NSURL *)url dataWithFileAtURL:(NSURL*)URL { AFCacheableItem *cachedItem = [self cacheableItemFromCacheStore:url]; if (cachedItem) { return cachedItem; } else { AFCacheableItem *item = [[AFCacheableItem alloc] initWithURL:url lastModified:[NSDate date] expireDate:nil]; [self importCacheableItem:item dataWithFileAtURL:URL]; return item; } } - (void)purgeCacheableItemForURL:(NSURL*)url { if (!url) { return; } AFCacheableItemInfo *cacheableItemInfo = [self.cachedItemInfos valueForKey:[url absoluteString]]; [self removeCacheEntry:cacheableItemInfo fileOnly:NO fallbackURL:url]; } - (void)purgePackageArchiveForURL:(NSURL*)url { [self purgeCacheableItemForURL:url]; } - (NSString*)userDataPathForPackageArchiveKey:(NSString*)archiveKey { if (archiveKey == nil) { return [NSString stringWithFormat:@"%@/%@", self.dataPath, kAFCacheUserDataFolder]; } else { return [NSString stringWithFormat:@"%@/%@/%@", self.dataPath, kAFCacheUserDataFolder, archiveKey]; } } // Return package information for package with urlstring as key - (AFPackageInfo*)packageInfoForURL:(NSURL*)url { NSString *key = [url absoluteString]; return [self.packageInfos valueForKey:key]; } #pragma mark - #pragma mark Deprecated methods // Deprecated. Use consumePackageArchive:preservePackageInfo: instead - (void)consumePackageArchive:(AFCacheableItem*)cacheableItem { [self consumePackageArchive:cacheableItem preservePackageInfo:NO]; } @end ================================================ FILE: src/shared/AFCache+PrivateAPI.h ================================================ /* * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Author: Michael Markowski (m.markowski@artifacts.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #import "AFCache.h" @class AFCache; @class AFCacheableItem; @interface AFCache (PrivateAPI) - (void)updateModificationDataAndTriggerArchiving:(AFCacheableItem *)obj; - (void)setConnectedToNetwork:(BOOL)connected; - (void)reinitialize; - (void)removeCacheEntryWithFilePath:(NSString*)filePath fileOnly:(BOOL) fileOnly; - (NSOutputStream*)createOutputStreamForItem:(AFCacheableItem*)cacheableItem; - (void)addItemToDownloadQueue:(AFCacheableItem*)item; - (BOOL)isQueuedURL:(NSURL*)url; - (BOOL)_fileExistsOrPendingForCacheableItem:(AFCacheableItem*)item; - (void)removeCacheEntry:(AFCacheableItemInfo*)info fileOnly:(BOOL) fileOnly; - (void)removeCacheEntry:(AFCacheableItemInfo*)info fileOnly:(BOOL) fileOnly fallbackURL:(NSURL *)fallbackURL; // TODO: This getter to its property is necessary as the category "Packaging" needs to access the private property. This is due to Packaging not being a real category - (NSOperationQueue*) packageArchiveQueue; @end @interface AFCacheableItem (PrivateAPI) - (BOOL)isQueuedOrDownloading; - (BOOL)hasValidContentLength; // Making synthesized getter and setter for private property public for private API - (void)setHasReturnedCachedItemBeforeRevalidation:(BOOL)value; - (BOOL)hasReturnedCachedItemBeforeRevalidation; @end @interface AFCacheableItemInfo (PrivateAPI) - (NSString*)newUniqueFilename; @end ================================================ FILE: src/shared/AFCache.h ================================================ /* * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Author: Michael Markowski (m.markowski@artifacts.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifdef USE_TOUCHXML #import "TouchXML.h" #endif #import "AFCacheableItem.h" #import "AFRequestConfiguration.h" #import "AFURLCache.h" #import #define kAFCacheExpireInfoDictionaryFilename @"kAFCacheExpireInfoDictionary" #define kAFCacheRedirectInfoDictionaryFilename @"kAFCacheRedirectInfoDictionary" #define kAFCachePackageInfoDictionaryFilename @"afcache_packageInfos" #define kAFCacheMetadataFilename @"afcache_metaData" #define kAFCacheInfoStoreCachedObjectsKey @"cachedObjects" #define kAFCacheInfoStoreRedirectsKey @"redirects" #define kAFCacheInfoStorePackageInfosKey @"packageInfos" #define kAFCacheVersionKey @"afcacheVersion" #define LOG_AFCACHE(m) NSLog(m); #define kAFCacheUserDataFolder @".userdata" // max cache item size in bytes #define kAFCacheDefaultMaxFileSize 1000000 // max number of concurrent connections #define kAFCacheDefaultConcurrentConnections 5 #define kHTTPHeaderIfModifiedSince @"If-Modified-Since" #define kHTTPHeaderIfNoneMatch @"If-None-Match" //do housekeeping every nth time archive is called (per session) #define kHousekeepingInterval 10 #define kDefaultDiskCacheDisplacementTresholdSize 100000000 #define kDefaultNetworkTimeoutIntervalIMSRequest 45 #define kDefaultNetworkTimeoutIntervalGETRequest 100 #define kDefaultNetworkTimeoutIntervalPackageRequest 100 #define kAFCacheNSErrorDomain @"AFCache" #define USE_ASSERTS true #define AFCachingURLHeader @"X-AFCache" #define AFCacheInternalRequestHeader @"X-AFCache-IntReq" extern const double kAFCacheInfiniteFileSize; enum { kAFCacheInvalidateEntry = 1 << 9, /* Returns cached file (if any) and then performs an IMS request (if file was already cached) or requests file for the first time (if not already cached). Option is ignored if kAFCacheNeverRevalidate is set. */ kAFCacheReturnFileBeforeRevalidation = 1 << 10, kAFIgnoreError = 1 << 11, kAFCacheIsPackageArchive = 1 << 12, kAFCacheRevalidateEntry = 1 << 13, // revalidate even when cache is running in offline mode kAFCacheNeverRevalidate = 1 << 14, kAFCacheJustFetchHTTPHeader = 1 << 15, // just fetch the http header }; typedef struct NetworkTimeoutIntervals { NSTimeInterval IMSRequest; NSTimeInterval GETRequest; NSTimeInterval PackageRequest; } NetworkTimeoutIntervals; @class AFCache; @class AFCacheableItem; @interface AFCache : NSObject /* * YES if offline mode is enabled (no files will be downloaded) or NO if disabled (default). */ @property (nonatomic, assign) BOOL offlineMode; /** * Maps from URL-String to AFCacheableItemInfo */ @property (nonatomic, strong) NSMutableDictionary *cachedItemInfos; /** * Maps from URL-String to its redirected URL-String */ @property (nonatomic, strong) NSMutableDictionary *urlRedirects; // TODO: "packageInfos" is not a good descriptive name. What means "info"? @property (nonatomic, strong) NSMutableDictionary *packageInfos; // holds CacheableItem objects (former NSURLConnection, changed 2013/03/26 by mic) @property (nonatomic, readonly) int totalRequestsForSession; @property (nonatomic, strong) NSDictionary *suffixToMimeTypeMap; @property (nonatomic, assign) double maxItemFileSize; @property (nonatomic, assign) double diskCacheDisplacementTresholdSize; @property (nonatomic, assign) NetworkTimeoutIntervals networkTimeoutIntervals; @property (nonatomic, assign) NSTimeInterval archiveInterval; /** * Skip check if data on disk is equal to byte size in cache info store. Might be helpful for debugging purposes. * * @since 0.9.2 */ @property (nonatomic, assign) BOOL skipValidContentLengthCheck; /* * change your user agent - do not abuse it */ @property (nonatomic, strong) NSString* userAgent; /* * set the path for your cachestore */ @property (nonatomic, copy) NSString *dataPath; /* * set the number of maximum concurrent downloadable items * Default is 5 */ // TODO: Rename to maxConcurrentConnections and introduce forward property with old name in DeprecatedAPI category @property (nonatomic, assign, getter=concurrentConnections, setter=setConcurrentConnections:) int concurrentConnections; /* * the download fails if HTTP error is above 400 * Default is YES */ @property (nonatomic, assign) BOOL failOnStatusCodeAbove400; /* * the items will be cached in the cachestore with a hashed filename instead of the URL path * Default is YES */ @property (nonatomic, assign) BOOL cacheWithHashname; /* * the items will be cached in the cachestore without any URL parameter * Default is NO */ @property (nonatomic, assign) BOOL cacheWithoutUrlParameter; /* * the items will be cached in the cachestore without the hostname * Default is NO */ @property (nonatomic, assign) BOOL cacheWithoutHostname; /* * pause the downloads. cancels any running downloads and puts them back into the queue */ @property (nonatomic, assign, getter=suspended, setter=setSuspended:) BOOL suspended; /* * check if we have an internet connection. can be observed */ @property (nonatomic, readonly) BOOL isConnectedToNetwork; /* * ignore any invalid SSL certificates * be careful with invalid SSL certificates! use only for testing or debugging * Default is NO */ @property (nonatomic, assign) BOOL disableSSLCertificateValidation; + (AFCache*)cacheForContext:(NSString*)context; - (NSString *)filenameForURL: (NSURL *) url; - (NSString *)filenameForURLString: (NSString *) URLString; - (NSString *)filePath: (NSString *) filename; - (NSString *)filePathForURL: (NSURL *) url; - (NSString *)fullPathForCacheableItem:(AFCacheableItem*)item; + (AFCache *)sharedInstance; - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id) aDelegate __attribute__((deprecated("use cacheItemForURL instead"))); - (AFCacheableItem *)cachedObjectForRequest: (NSURLRequest *) aRequest delegate: (id) aDelegate __attribute__((deprecated("use cacheItemForURL instead"))); - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id) aDelegate options: (int) options __attribute__((deprecated("use cacheItemForURL instead"))); - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id) aDelegate selector: (SEL) aSelector options: (int) options __attribute__((deprecated("use cacheItemForURL instead"))); - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id) aDelegate selector: (SEL) aSelector options: (int) options userData:(id)userData __attribute__((deprecated("use cacheItemForURL instead"))); - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id) aDelegate selector: (SEL) aSelector didFailSelector: (SEL) aFailSelector options: (int) options __attribute__((deprecated("use cacheItemForURL instead"))); - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id) aDelegate selector: (SEL) aSelector didFailSelector: (SEL) aFailSelector options: (int) options userData: (id)userData username: (NSString *)aUsername password: (NSString *)aPassword request: (NSURLRequest*)aRequest __attribute__((deprecated("use cacheItemForURL instead"))); - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id)aDelegate selector: (SEL)aSelector didFailSelector: (SEL)aFailSelector completionBlock: (id)aCompletionBlock failBlock: (id)aFailBlock progressBlock: (id)aProgressBlock options: (int)options userData: (id)userData username: (NSString *)aUsername password: (NSString *)aPassword request: (NSURLRequest*)aRequest __attribute__((deprecated("use cacheItemForURL instead"))); - (AFCacheableItem *)cachedObjectForURLSynchronous: (NSURL *) url; - (AFCacheableItem *)cachedObjectForURLSynchronous:(NSURL *)url options: (int)options; - (BOOL)isQueuedOrDownloadingURL:(NSURL *)url; - (BOOL)isDownloadingURL:(NSURL *)url; - (void)invalidateAll; - (void)archive; /** * Starts the archiving Thread without a delay. */ - (void)archiveNow; /** * NOTE: "offline mode" means: Dear AFCache, please serve everything from cache without making any connections. * It does NOT mean that there's no internet connectivity. You may check this by calling "isConnectedToNetwork"] */ - (BOOL)offlineMode; - (void)setOfflineMode:(BOOL)value; - (int)totalRequestsForSession; - (void)doHousekeeping; - (void)doHousekeepingWithRequiredCacheItemURLs:(NSSet*)requiredURLs; - (BOOL)hasCachedItemForURL:(NSURL *)url; - (AFCacheableItem *)cacheableItemFromCacheStore: (NSURL *) url; - (unsigned long)diskCacheSize; /* * Cancel any asynchronous operations and downloads */ - (void)cancelAllRequestsForURL:(NSURL *)url; - (void)cancelAsynchronousOperationsForURL:(NSURL *)url itemDelegate:(id)itemDelegate; - (void)cancelAsynchronousOperationsForDelegate:(id)itemDelegate; /* * Prioritize the URL or item in the queue */ - (void)prioritizeURL:(NSURL*)url; /* * Flush and start loading all items in the queue */ - (void)flushDownloadQueue; #pragma mark - Public API for getting cache items (do not use any other, replace your existing deprecated calls with new ones) /* * Get a cached item from cache. * * @param url the requested url * @param urlCredential the credential for requested url * @param completionBlock * @param failBlock */ - (AFCacheableItem *)cacheItemForURL:(NSURL *)url urlCredential:(NSURLCredential*)urlCredential completionBlock:(AFCacheableItemBlock)completionBlock failBlock:(AFCacheableItemBlock)failBlock; /* * Get a cached item from cache. * * @param url the requested url * @param urlCredential the credential for requested url * @param completionBlock * @param failBlock * @param progressBlock */ - (AFCacheableItem *)cacheItemForURL:(NSURL *)url urlCredential:(NSURLCredential*)urlCredential completionBlock:(AFCacheableItemBlock)completionBlock failBlock:(AFCacheableItemBlock)failBlock progressBlock:(AFCacheableItemBlock)progressBlock; /* * Get a cached item from cache. * * @param url the requested url * @param urlCredential the credential for requested url * @param completionBlock * @param failBlock * @param progressBlock * @param requestConfiguration */ - (AFCacheableItem *)cacheItemForURL:(NSURL *)url urlCredential:(NSURLCredential*)urlCredential completionBlock:(AFCacheableItemBlock)completionBlock failBlock:(AFCacheableItemBlock)failBlock progressBlock:(AFCacheableItemBlock)progressBlock requestConfiguration:(AFRequestConfiguration*)requestConfiguration; @end #pragma mark - LoggingSupport @interface AFCache( LoggingSupport ) /* * currently ignored if not built against EngineRoom - SUBJECT TO CHANGE WITHOUT NOTICE */ + (void) setLoggingEnabled: (BOOL) enabled; + (void) setLogFormat: (NSString *) logFormat; @end @interface AFCache( BLOCKS ) - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url completionBlock: (AFCacheableItemBlock)aCompletionBlock failBlock: (AFCacheableItemBlock)aFailBlock options: (int) options __attribute__((deprecated("use cacheItemForURL instead"))); - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url completionBlock: (AFCacheableItemBlock)aCompletionBlock failBlock: (AFCacheableItemBlock)aFailBlock options: (int) options userData: (id)userData username: (NSString *)aUsername password: (NSString *)aPassword __attribute__((deprecated("use cacheItemForURL instead"))); #pragma mark With progress block - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url completionBlock: (AFCacheableItemBlock)aCompletionBlock failBlock: (AFCacheableItemBlock)aFailBlock progressBlock: (AFCacheableItemBlock)aProgressBlock options: (int) options userData: (id)userData username: (NSString *)aUsername password: (NSString *)aPassword __attribute__((deprecated("use cacheItemForURL instead"))); - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url completionBlock: (AFCacheableItemBlock)aCompletionBlock failBlock: (AFCacheableItemBlock)aFailBlock progressBlock: (AFCacheableItemBlock)aProgressBlock options: (int) options __attribute__((deprecated("use cacheItemForURL instead"))); @end ================================================ FILE: src/shared/AFCache.m ================================================ /* * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Author: Michael Markowski (m.markowski@artifacts.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #import "AFCache+PrivateAPI.h" #import "AFCache+Mimetypes.h" #import "DateParser.h" #include #include #include #import #import #import "AFRegexString.h" #import "AFCache_Logging.h" #import "AFDownloadOperation.h" #import "AFCacheableItem+FileAttributes.h" #import #if USE_ASSERTS #define ASSERT_NO_CONNECTION_WHEN_IN_OFFLINE_MODE_FOR_URL(url) NSAssert( [(url) isFileURL] || [self offlineMode] == NO, @"No connection should be opened if we're in offline mode - this seems like a bug") #else #define ASSERT_NO_CONNECTION_WHEN_IN_OFFLINE_MODE_FOR_URL(url) do{}while(0) #endif const double kAFCacheInfiniteFileSize = 0.0; const double kAFCacheArchiveDelay = 30.0; // archive every 30s extern NSString* const UIApplicationWillResignActiveNotification; @interface AFCache() @property (nonatomic, copy) NSString *context; @property (nonatomic, strong) NSTimer *archiveTimer; @property (nonatomic, assign) BOOL wantsToArchive; @property (nonatomic, assign) BOOL connectedToNetwork; @property (nonatomic, strong) NSOperationQueue *packageArchiveQueue; @property (nonatomic, strong) NSOperationQueue *downloadOperationQueue; @property (nonatomic, strong) NSString* version; @property (nonatomic, assign, readonly) NSString* infoDictionaryPath; @property (nonatomic, assign, readonly) NSString* metaDataDictionaryPath; @property (nonatomic, assign, readonly) NSString* expireInfoDictionaryPath; @end @implementation AFCache static AFCache *sharedAFCacheInstance = nil; static NSMutableDictionary* AFCache_contextCache = nil; #pragma mark singleton methods + (AFCache *)sharedInstance { @synchronized(self) { if (!sharedAFCacheInstance) { sharedAFCacheInstance = [[self alloc] initWithContext:nil]; sharedAFCacheInstance.diskCacheDisplacementTresholdSize = kDefaultDiskCacheDisplacementTresholdSize; } } return sharedAFCacheInstance; } #pragma mark init methods - (id)initWithContext:(NSString*)context { if (!context && sharedAFCacheInstance) { return [AFCache sharedInstance]; } self = [super init]; if (self) { #if TARGET_OS_IPHONE [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(serializeState) name:UIApplicationWillResignActiveNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(serializeState) name:UIApplicationWillTerminateNotification object:nil]; #endif if (!AFCache_contextCache) { AFCache_contextCache = [[NSMutableDictionary alloc] init]; } if (context) { [AFCache_contextCache setObject:[NSValue valueWithPointer:(__bridge const void *)(self)] forKey:context]; } _context = [context copy]; [self reinitialize]; [self initMimeTypes]; } return self; } - (void)initialize { _offlineMode = NO; _wantsToArchive = NO; _connectedToNetwork = NO; _archiveInterval = kAFCacheArchiveDelay; _failOnStatusCodeAbove400 = YES; _cacheWithHashname = YES; _maxItemFileSize = kAFCacheInfiniteFileSize; _networkTimeoutIntervals.IMSRequest = kDefaultNetworkTimeoutIntervalIMSRequest; _networkTimeoutIntervals.GETRequest = kDefaultNetworkTimeoutIntervalGETRequest; _networkTimeoutIntervals.PackageRequest = kDefaultNetworkTimeoutIntervalPackageRequest; _totalRequestsForSession = 0; _packageArchiveQueue = [[NSOperationQueue alloc] init]; [_packageArchiveQueue setMaxConcurrentOperationCount:1]; _downloadOperationQueue = [[NSOperationQueue alloc] init]; [_downloadOperationQueue setMaxConcurrentOperationCount:kAFCacheDefaultConcurrentConnections]; if (!_dataPath) { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); NSString *appId = [@"afcache" stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]; _dataPath = [[[paths objectAtIndex: 0] stringByAppendingPathComponent: appId] copy]; } [self deserializeState]; /* check for existence of cache directory */ if ([[NSFileManager defaultManager] fileExistsAtPath:_dataPath]) { AFLog(@ "Successfully unarchived cache store"); } else { NSError *error = nil; if (![[NSFileManager defaultManager] createDirectoryAtPath:_dataPath withIntermediateDirectories:YES attributes:nil error:&error]) { AFLog(@ "Failed to create cache directory at path %@: %@", _dataPath, [error description]); } else { NSString *dataPath = _dataPath; if ([[dataPath pathComponents] containsObject:@"Library"]) { while (![[dataPath lastPathComponent] isEqualToString:@"Library"] && ![[dataPath lastPathComponent] isEqualToString:@"Caches"]) { [AFCache addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:dataPath]]; dataPath = [dataPath stringByDeletingLastPathComponent]; } } } } [AFCache addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:_dataPath]]; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; if (_context) { [AFCache_contextCache removeObjectForKey:_context]; } } - (void)setDataPath:(NSString*)newDataPath { if (self.context && self.dataPath) { NSLog(@"Error: Can't change data path on instanced AFCache"); NSAssert(NO, @"Can't change data path on instanced AFCache"); return; } if (self.wantsToArchive) { [self serializeState]; } _dataPath = [newDataPath copy]; double fileSize = self.maxItemFileSize; [self reinitialize]; self.maxItemFileSize = fileSize; } - (int)concurrentConnections { return [self.downloadOperationQueue maxConcurrentOperationCount]; } - (void)setConcurrentConnections:(int)maxConcurrentConnections { [self.downloadOperationQueue setMaxConcurrentOperationCount:maxConcurrentConnections]; } // TODO: If we really need "named" caches ("context" is the wrong word), then realize this concept as a category, but not here + (AFCache*)cacheForContext:(NSString *)context { if (!AFCache_contextCache) { AFCache_contextCache = [[NSMutableDictionary alloc] init]; } if (!context) { return [self sharedInstance]; } AFCache* cache = [[AFCache_contextCache objectForKey:context] pointerValue]; if (!cache) { cache = [[[self class] alloc] initWithContext:context]; } return cache; } // The method reinitialize really initializes the cache. // This is usefull for testing, when you want to, uh, reinitialize - (void)reinitialize { if (self.wantsToArchive) { [self serializeState]; } [self cancelAllDownloads]; [self initialize]; } +(BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL { #if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_5_1 || TARGET_OS_MAC && MAC_OS_X_VERSION_MIN_ALLOWED < MAC_OS_X_VERSION_10_8 if (![[NSFileManager defaultManager] fileExistsAtPath:[URL path]]) { return NO; } NSError *error = nil; BOOL success = [URL setResourceValue:[NSNumber numberWithBool:YES] forKey: NSURLIsExcludedFromBackupKey error:&error]; if (!success) { NSLog(@"Error excluding %@ from backup: %@", [URL lastPathComponent], error); } return success; #else NSLog(@"ERROR: System does not support excluding files from backup"); return NO; #endif } // remove all cache entries are not in a given set - (void)doHousekeepingWithRequiredCacheItemURLs:(NSSet*)requiredURLs { NSMutableSet* fileNames = [NSMutableSet set]; NSMutableDictionary* cacheInfoForFileName = [NSMutableDictionary dictionary]; for (NSURL* cacheURL in requiredURLs) { AFCacheableItem* item = [self cacheableItemFromCacheStore:cacheURL]; if (item.info) { NSString* fileName = item.info.filename; [fileNames addObject:fileName]; [cacheInfoForFileName setObject:item.info forKey:fileName]; } } [fileNames addObject:kAFCachePackageInfoDictionaryFilename]; [fileNames addObject:kAFCacheMetadataFilename]; [fileNames addObject:kAFCacheExpireInfoDictionaryFilename]; NSSet* fileNameSet = [NSSet setWithSet:fileNames]; __block NSMutableArray* urlsToRemove = [NSMutableArray array]; [self performBlockOnAllCacheFiles:^(NSURL *url) { NSError *error; NSNumber *isDirectory = nil; if (! [url getResourceValue:&isDirectory forKey:NSURLIsDirectoryKey error:&error]) { NSLog(@"ERROR: cleanup encountered error: %@", error); } else if (! [isDirectory boolValue]) { NSString* fileName = [url lastPathComponent]; if(![fileNameSet containsObject:[fileName stringByDeletingPathExtension]]) { [urlsToRemove addObject:url]; } } }]; for (NSURL* url in urlsToRemove) { [self removeCacheEntryAndFileForFileURL:url]; } } -(void)performBlockOnAllCacheFiles:(void (^)(NSURL* url))cacheItemActionBlock { NSFileManager *fileManager = [NSFileManager defaultManager]; NSURL *directoryURL = [NSURL fileURLWithPath:self.dataPath]; NSDirectoryEnumerator *enumerator = [fileManager enumeratorAtURL:directoryURL includingPropertiesForKeys:nil options:0 errorHandler:^(NSURL *url, NSError *error) { NSLog(@"ERROR: encountered error while processing all cache files: %@", error); return YES; }]; for (NSURL *url in enumerator) { cacheItemActionBlock(url); } } // remove all expired cache entries // TODO: exchange with a better displacement strategy - (void)doHousekeeping { if ([self offlineMode]) return; // don't cleanup if we're in offline mode unsigned long size = [self diskCacheSize]; if (size < self.diskCacheDisplacementTresholdSize) return; NSDate *now = [NSDate date]; NSArray *keys = nil; NSString *key = nil; for (AFCacheableItemInfo *info in [self.cachedItemInfos allValues]) { if (info.expireDate && info.expireDate == [now earlierDate:info.expireDate]) { keys = [self.cachedItemInfos allKeysForObject:info]; if ([keys count] > 0) { key = [keys objectAtIndex:0]; [self removeCacheEntry:info fileOnly:NO]; NSString* fullPath = [self.dataPath stringByAppendingPathComponent:key]; [self removeCacheEntryWithFilePath:fullPath fileOnly:NO]; } } } } - (void)removeCacheEntryWithFilePath:(NSString *)filePath fileOnly:(BOOL)fileOnly { // TODO: Implement me or remove me (I am called in doHousekeeping) NSLog(@"TODO: Implement me or remove me (I am called in doHousekeeping)"); } - (unsigned long)diskCacheSize { #ifdef AFCACHE_MAINTAINER_WARNINGS #warning TODO determine diskCacheSize #endif return 0; #define MINBLOCK 4096 NSDictionary *fattrs; NSDirectoryEnumerator *de; unsigned long size = 0; de = [[NSFileManager defaultManager] enumeratorAtPath:self.dataPath]; while([de nextObject]) { fattrs = [de fileAttributes]; if (![[fattrs valueForKey:NSFileType] isEqualToString:NSFileTypeDirectory]) { size += ((([[fattrs valueForKey:NSFileSize] unsignedIntValue] + MINBLOCK - 1) / MINBLOCK) * MINBLOCK); } } return size; } #pragma mark - Public API for getting cached items (do not use any other) - (AFCacheableItem*)cacheItemForURL:(NSURL *)url urlCredential:(NSURLCredential *)urlCredential completionBlock:(AFCacheableItemBlock)completionBlock failBlock:(AFCacheableItemBlock)failBlock { // delegate to our internal method return [self _internalCacheItemForURL:url urlCredential:urlCredential completionBlock:completionBlock failBlock:failBlock progressBlock:nil requestConfiguration:nil]; } - (AFCacheableItem*)cacheItemForURL:(NSURL *)url urlCredential:(NSURLCredential *)urlCredential completionBlock:(AFCacheableItemBlock)completionBlock failBlock:(AFCacheableItemBlock)failBlock progressBlock:(AFCacheableItemBlock)progressBlock { // delegate to our internal method return [self _internalCacheItemForURL:url urlCredential:urlCredential completionBlock:completionBlock failBlock:failBlock progressBlock:progressBlock requestConfiguration:nil]; } - (AFCacheableItem*)cacheItemForURL:(NSURL *)url urlCredential:(NSURLCredential *)urlCredential completionBlock:(AFCacheableItemBlock)completionBlock failBlock:(AFCacheableItemBlock)failBlock progressBlock:(AFCacheableItemBlock)progressBlock requestConfiguration:(AFRequestConfiguration*)requestConfiguration { // delegate to our internal method return [self _internalCacheItemForURL:url urlCredential:urlCredential completionBlock:completionBlock failBlock:failBlock progressBlock:progressBlock requestConfiguration:requestConfiguration]; } - (AFCacheableItem*)_internalCacheItemForURL:(NSURL *)url urlCredential:(NSURLCredential *)urlCredential completionBlock:(AFCacheableItemBlock)completionBlock failBlock:(AFCacheableItemBlock)failBlock progressBlock:(AFCacheableItemBlock)progressBlock requestConfiguration:(AFRequestConfiguration*)requestConfiguration { // validate URL and handle invalid url if (![self isValidRequestURL:url]) { [self handleInvalidURLRequest:failBlock]; return nil; } if ([url isFileURL]) { AFCacheableItem *shortCircuitItem = [[AFCacheableItem alloc] init]; shortCircuitItem.url = url; if ([[NSFileManager defaultManager] fileExistsAtPath:[url path]]) { shortCircuitItem.data = [NSData dataWithContentsOfURL: url]; if (completionBlock) { completionBlock(shortCircuitItem); } } else { if (failBlock) { failBlock(shortCircuitItem); } } return shortCircuitItem; } // increase count of request in this session _totalRequestsForSession++; // extract option-parts from requestConfiguration.options BOOL invalidateCacheEntry = (requestConfiguration.options & kAFCacheInvalidateEntry) != 0; BOOL revalidateCacheEntry = (requestConfiguration.options & kAFCacheRevalidateEntry) != 0; BOOL justFetchHTTPHeader = (requestConfiguration.options & kAFCacheJustFetchHTTPHeader) != 0; BOOL isPackageArchive = (requestConfiguration.options & kAFCacheIsPackageArchive) != 0; BOOL neverRevalidate = (requestConfiguration.options & kAFCacheNeverRevalidate) != 0; BOOL returnFileBeforeRevalidation = (requestConfiguration.options & kAFCacheReturnFileBeforeRevalidation) != 0; // Update URL with redirected URL if in offline mode BOOL didRewriteURL = NO; // the request URL might be rewritten by the cache internally when we're in offline mode url = [self urlOrRedirectURLInOfflineModeForURL:url redirected:&didRewriteURL]; // try to get object from disk AFCacheableItem *item = nil; if (!invalidateCacheEntry) { item = [self cacheableItemFromCacheForURL:url]; } BOOL performGETRequest = NO; // will be set to YES if we're online and have a cache miss if (!item) { // if we are in offline mode and do not have a cached version, so return nil if (!url.isFileURL && [self offlineMode]) { if (failBlock) { failBlock(nil); } return nil; } // we're online - create a new item, since we had a cache miss item = [[AFCacheableItem alloc] init]; performGETRequest = YES; } // setup item item.tag = self.totalRequestsForSession; item.cache = self; // calling this particular setter does not increase the retain count to avoid a cyclic reference from a cacheable item to the cache. item.url = url; item.userData = requestConfiguration.userData; item.urlCredential = urlCredential; item.justFetchHTTPHeader = justFetchHTTPHeader; item.isPackageArchive = isPackageArchive; item.URLInternallyRewritten = didRewriteURL; item.servedFromCache = !performGETRequest; item.info.request = requestConfiguration.request; item.hasReturnedCachedItemBeforeRevalidation = NO; if (!self.cacheWithHashname) { item.info.filename = [self filenameForURL:item.url]; } [item addCompletionBlock:completionBlock failBlock:failBlock progressBlock:progressBlock]; if (performGETRequest) { // TODO: Why do we cache the item here? Nothing has been downloaded yet? [self.cachedItemInfos setObject:item.info forKey:[url absoluteString]]; [self addItemToDownloadQueue:item]; return item; } else { // object found in cache. // now check if it is fresh enough to serve it from disk. // pretend it's fresh when cache is in offline mode item.servedFromCache = YES; if (![self isConnectedToNetwork] || ([self offlineMode] && !revalidateCacheEntry)) { // return item and call delegate only if fully loaded if (item.data) { if (completionBlock) { completionBlock(item); } return item; } if (![self isQueuedOrDownloadingURL:item.url]) { if ([item hasValidContentLength] && !item.canMapData) { // Perhaps the item just can not be mapped. if (completionBlock) { completionBlock(item); } return item; } // nobody is downloading, but we got the item from the cachestore. // Something is wrong -> fail if (failBlock) { failBlock(item); } return nil; } } item.isRevalidating = revalidateCacheEntry; // Check if item is fully loaded already if (item.canMapData && !item.data && ![item hasValidContentLength]) { [self addItemToDownloadQueue:item]; return item; } // Item is fresh, so call didLoad selector and return the cached item. if ([item isFresh] || returnFileBeforeRevalidation || neverRevalidate) { item.cacheStatus = kCacheStatusFresh; #ifdef RESUMEABLE_DOWNLOAD if(item.currentContentLength < item.info.contentLength) { //resume download item.cacheStatus = kCacheStatusDownloading; [self handleDownloadItem:item ignoreQueue:shouldIgnoreQueue]; } #else item.currentContentLength = item.info.contentLength; if (completionBlock) { completionBlock(item); } AFLog(@"serving from cache: %@", item.url); #endif if (returnFileBeforeRevalidation) { item.hasReturnedCachedItemBeforeRevalidation = YES; } else { return item; } //item.info.responseTimestamp = [NSDate timeIntervalSinceReferenceDate]; } // Item is not fresh, fire an If-Modified-Since request //#ifndef RESUMEABLE_DOWNLOAD // reset data, because there may be old data set already item.data = nil;//will cause the data to be reloaded from file when accessed next time //#endif // save information that object was in cache and has to be revalidated item.cacheStatus = kCacheStatusRevalidationPending; NSMutableURLRequest *IMSRequest = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:self.networkTimeoutIntervals.IMSRequest]; NSDate *lastModified = [NSDate dateWithTimeIntervalSinceReferenceDate: [item.info.lastModified timeIntervalSinceReferenceDate]]; [IMSRequest addValue:[DateParser formatHTTPDate:lastModified] forHTTPHeaderField:kHTTPHeaderIfModifiedSince]; [IMSRequest setValue:@"" forHTTPHeaderField:AFCacheInternalRequestHeader]; if (item.info.eTag) { [IMSRequest addValue:item.info.eTag forHTTPHeaderField:kHTTPHeaderIfNoneMatch]; } else { NSDate *lastModified = [NSDate dateWithTimeIntervalSinceReferenceDate: [item.info.lastModified timeIntervalSinceReferenceDate]]; // TODO: Why do we overwrite the existing header field here already set above? [IMSRequest addValue:[DateParser formatHTTPDate:lastModified] forHTTPHeaderField:kHTTPHeaderIfModifiedSince]; } item.IMSRequest = IMSRequest; ASSERT_NO_CONNECTION_WHEN_IN_OFFLINE_MODE_FOR_URL(IMSRequest.URL); [self addItemToDownloadQueue:item]; } return item; } - (AFCacheableItem *)cacheableItemFromCacheForURL:(NSURL *)url { AFCacheableItem *item = [self cacheableItemFromCacheStore:url]; // check validity of cached item // TODO: (Claus Weymann:) validate this check (does this ensure that we continue downloading but also detect corrupt files?) if (![item isDataLoaded] && ([item hasDownloadFileAttribute] || ![item hasValidContentLength]) && ![self isDownloadingURL:url]) { //Claus Weymann: item is not vailid and not allready being downloaded, set item to nil to trigger download item = nil; } return item; } - (NSURL*)urlOrRedirectURLInOfflineModeForURL:(NSURL *)url redirected:(BOOL *)redirected { *redirected = NO; if ([self offlineMode]) { // In offline mode we change the request URL to the redirected URL (if any) // TODO: Michael Markowski has left this comment (I don't know if it still holds true): // AFAIU redirects of type 302 MUST NOT be cached // since we do not distinguish between 301 and 302 or other types of redirects, nor save the status code anywhere // we simply only check the cached redirects if we're in offline mode // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html 13.4 Response Cacheability NSString *redirectURL = [self.urlRedirects valueForKey:[url absoluteString]]; if (redirectURL) { url = [NSURL URLWithString: redirectURL]; *redirected = YES; } } return url; } #pragma mark - Deprecated methods for getting cached items // DO NOT USE THIS METHOD - it is deprecated - (AFCacheableItem *)cachedObjectForURL:(NSURL *)url delegate: (id) aDelegate { return [self cachedObjectForURL: url delegate: aDelegate options: 0]; } // DO NOT USE THIS METHOD - it is deprecated - (AFCacheableItem *)cachedObjectForRequest:(NSURLRequest *)aRequest delegate: (id) aDelegate { return [self cachedObjectForURL: aRequest.URL delegate: aDelegate selector: @selector(connectionDidFinish:) didFailSelector: @selector(connectionDidFail:) options: 0 userData: nil username: nil password: nil request:aRequest]; } // DO NOT USE THIS METHOD - it is deprecated - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id) aDelegate options: (int) options { return [self cachedObjectForURL: url delegate: aDelegate selector: @selector(connectionDidFinish:) didFailSelector: @selector(connectionDidFail:) options: options userData: nil username: nil password: nil request:nil]; } // DO NOT USE THIS METHOD - it is deprecated - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id) aDelegate selector: (SEL) aSelector options: (int) options { return [self cachedObjectForURL: url delegate: aDelegate selector: aSelector didFailSelector: @selector(connectionDidFail:) options: options userData: nil username: nil password: nil request:nil]; } // DO NOT USE THIS METHOD - it is deprecated - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id) aDelegate selector: (SEL) aSelector options: (int) options userData: (id)userData { return [self cachedObjectForURL: url delegate: aDelegate selector: aSelector didFailSelector: @selector(connectionDidFail:) options: options userData: userData username: nil password: nil request:nil]; } // DO NOT USE THIS METHOD - it is deprecated - (AFCacheableItem *)cachedObjectForURL:(NSURL *)url delegate:(id) aDelegate selector:(SEL)aSelector didFailSelector:(SEL)didFailSelector options: (int) options { return [self cachedObjectForURL:url delegate:aDelegate selector:aSelector didFailSelector:didFailSelector options:options userData:nil username:nil password:nil request:nil]; } /* * Performs an asynchroneous request and calls delegate when finished loading * */ // DO NOT USE THIS METHOD - it is deprecated - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id) aDelegate selector: (SEL) aSelector didFailSelector: (SEL) aFailSelector options: (int) options userData: (id)userData username: (NSString *)aUsername password: (NSString *)aPassword request: (NSURLRequest*)aRequest { return [self cachedObjectForURL:url delegate:aDelegate selector:aSelector didFailSelector:aFailSelector completionBlock:nil failBlock:nil progressBlock:nil options:options userData:userData username:aUsername password:aPassword request:aRequest]; } // DO NOT USE THIS METHOD - it is deprecated - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url delegate: (id)aDelegate selector: (SEL)aSelector didFailSelector: (SEL)aFailSelector completionBlock: (id)aCompletionBlock failBlock: (id)aFailBlock progressBlock: (id)aProgressBlock options: (int)options userData: (id)userData username: (NSString *)aUsername password: (NSString *)aPassword request: (NSURLRequest*)aRequest { // to provide backward compability we convert this call to our new API __weak id weakDelegate = aDelegate; AFRequestConfiguration *requestConfiguration = [[AFRequestConfiguration alloc] init]; requestConfiguration.options = options; requestConfiguration.request = aRequest; requestConfiguration.userData = userData; NSURLCredential *urlCredential; if (aUsername && aPassword) { urlCredential = [NSURLCredential credentialWithUser:aUsername password:aPassword persistence:NSURLCredentialPersistenceForSession]; } id completionBlock = aCompletionBlock; if (!completionBlock) { completionBlock = ^(AFCacheableItem *item) { // deprecated stuff [weakDelegate performSelector:aSelector withObject:item]; }; } id failBlock = aFailBlock; if (!failBlock) { failBlock = ^(AFCacheableItem *item) { // deprecated stuff [weakDelegate performSelector:aFailSelector withObject:item]; }; } // the progress (as selector) is implicitly done in AFCacheableItem: // - (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)receivedData id progressBlock = aProgressBlock; // delegate to our internal method AFCacheableItem *item = [self _internalCacheItemForURL:url urlCredential:urlCredential completionBlock:completionBlock failBlock:failBlock progressBlock:progressBlock requestConfiguration:requestConfiguration]; item.delegate = weakDelegate; return item; } #pragma mark - synchronous request methods /* * performs a synchroneous request * */ - (AFCacheableItem *)cachedObjectForURLSynchronous: (NSURL *) url { return [self cachedObjectForURLSynchronous:url options:0]; } - (AFCacheableItem *)cachedObjectForURLSynchronous:(NSURL *)url options: (int) options { #if MAINTAINER_WARNINGS //#warning BK: this is in support of using file urls with ste-engine - no info yet for shortCircuiting #endif if( [url isFileURL] ) { AFCacheableItem *shortCircuitItem = [[AFCacheableItem alloc] init]; shortCircuitItem.data = [NSData dataWithContentsOfURL: url]; return shortCircuitItem; } bool invalidateCacheEntry = (options & kAFCacheInvalidateEntry) != 0; AFCacheableItem *obj = nil; if (url) { // try to get object from disk if cache is enabled if (!invalidateCacheEntry) { obj = [self cacheableItemFromCacheStore: url]; } // Object not in cache. Load it from url. if (!obj) { NSURLResponse *response = nil; NSError *err = nil; NSURLRequest *request = [[NSURLRequest alloc] initWithURL: url]; // The synchronous request will indirectly invoke AFURLCache's // storeCachedResponse:forRequest: and add a cacheable item // accordingly. ASSERT_NO_CONNECTION_WHEN_IN_OFFLINE_MODE_FOR_URL(url); NSData *data = [NSURLConnection sendSynchronousRequest: request returningResponse: &response error: &err]; if ([response respondsToSelector: @selector(statusCode)]) { NSInteger statusCode = [( (NSHTTPURLResponse *)response )statusCode]; if (statusCode != 200 && statusCode != 304) { return nil; } } // If request was successful there should be a cacheable item now. if (data) { obj = [self cacheableItemFromCacheStore: url]; } } } return obj; } #pragma mark - URL cache state testing - (BOOL)isQueuedOrDownloadingURL: (NSURL*)url { return ([self isQueuedURL:url] || [self isDownloadingURL:url]); } - (BOOL)isDownloadingURL:(NSURL *)url { return ([[self nonCancelledDownloadOperationForURL:url] isExecuting]); } - (AFDownloadOperation*)nonCancelledDownloadOperationForURL:(NSURL*)url { for (AFDownloadOperation *downloadOperation in [self.downloadOperationQueue operations]) { if (![downloadOperation isCancelled] && [[downloadOperation.cacheableItem.url absoluteString] isEqualToString:[url absoluteString]]) { return downloadOperation; } } return nil; } #pragma mark - State (de-)serialization - (void)serializeState { @synchronized (self.archiveTimer) { [self.archiveTimer invalidate]; self.wantsToArchive = NO; [self serializeState:[self stateDictionary]]; } } - (NSDictionary*)stateDictionary { return @{kAFCacheInfoStoreCachedObjectsKey : self.cachedItemInfos, kAFCacheInfoStoreRedirectsKey : self.urlRedirects, kAFCacheInfoStorePackageInfosKey : self.packageInfos, kAFCacheVersionKey : self.version?:@"", }; } //TODO: state dictionary bundles information about state but is not serialized (persisted) as such. it splits into parts and serializes some of the information. why? - (void)serializeState:(NSDictionary*)state { @autoreleasepool { #if AFCACHE_LOGGING_ENABLED AFLog(@"start archiving"); CFAbsoluteTime start = CFAbsoluteTimeGetCurrent(); #endif @synchronized(self) { @autoreleasepool { if (self.totalRequestsForSession % kHousekeepingInterval == 0) [self doHousekeeping]; NSDictionary *infoStore = @{ kAFCacheInfoStoreCachedObjectsKey : state[kAFCacheInfoStoreCachedObjectsKey], kAFCacheInfoStoreRedirectsKey : state[kAFCacheInfoStoreRedirectsKey]}; [self saveDictionary:infoStore ToFile:self.expireInfoDictionaryPath]; NSDictionary* packageInfos = [state valueForKey:kAFCacheInfoStorePackageInfosKey]; [self saveDictionary:packageInfos ToFile:self.infoDictionaryPath]; NSDictionary* metaData = @{kAFCacheVersionKey:[state valueForKey:kAFCacheVersionKey]}; [self saveDictionary:metaData ToFile:self.metaDataDictionaryPath]; } } #if AFCACHE_LOGGING_ENABLED AFLog(@"Finish archiving in %f", CFAbsoluteTimeGetCurrent() - start); #endif } } -(void)saveDictionary:(NSDictionary*)dictionary ToFile:(NSString*)fileName { NSData* serializedData = [NSKeyedArchiver archivedDataWithRootObject:dictionary]; if (serializedData) { NSError* error = nil; #if TARGET_OS_IPHONE NSDataWritingOptions options = NSDataWritingAtomic | NSDataWritingFileProtectionNone; #else NSDataWritingOptions options = NSDataWritingAtomic; #endif if (![serializedData writeToFile:fileName options:options error:&error]) { NSLog(@"Error: Could not write dictionary to file '%@': Error = %@, infoStore = %@", fileName, error, dictionary); } [AFCache addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:fileName]]; } else { NSLog(@"Error: Could not archive dictionary %@", dictionary); } } - (void)deserializeState { // Deserialize cacheable item info store NSDictionary *archivedExpireDates = [NSKeyedUnarchiver unarchiveObjectWithFile: self.expireInfoDictionaryPath]; NSMutableDictionary *cachedItemInfos = [archivedExpireDates objectForKey:kAFCacheInfoStoreCachedObjectsKey]; NSMutableDictionary *urlRedirects = [archivedExpireDates objectForKey:kAFCacheInfoStoreRedirectsKey]; if (cachedItemInfos && urlRedirects) { _cachedItemInfos = [NSMutableDictionary dictionaryWithDictionary:cachedItemInfos]; _urlRedirects = [NSMutableDictionary dictionaryWithDictionary: urlRedirects]; AFLog(@ "Successfully unarchived expires dictionary"); } else { _cachedItemInfos = [NSMutableDictionary dictionary]; _urlRedirects = [NSMutableDictionary dictionary]; AFLog(@ "Created new expires dictionary"); } // Deserialize package infos NSDictionary *archivedPackageInfos = [NSKeyedUnarchiver unarchiveObjectWithFile: self.infoDictionaryPath]; if (archivedPackageInfos) { _packageInfos = [NSMutableDictionary dictionaryWithDictionary: archivedPackageInfos]; AFLog(@ "Successfully unarchived package infos dictionary"); } else { _packageInfos = [[NSMutableDictionary alloc] init]; AFLog(@ "Created new package infos dictionary"); } // Deserialize metaData NSDictionary* metaData = [NSKeyedUnarchiver unarchiveObjectWithFile: self.metaDataDictionaryPath]; if ([metaData isKindOfClass:[NSDictionary class]]) { [self migrateFromVersion:metaData[kAFCacheVersionKey]]; } else { [self migrateFromVersion:nil]; } } - (void)startArchiveThread:(NSTimer*)timer { self.wantsToArchive = NO; NSMutableDictionary* state = [NSMutableDictionary dictionaryWithDictionary: [self stateDictionary]]; // Copy state items as they shall not be altered when state is persisted // TODO: This copy code must be synchronized with state modifications for (id key in [state allKeys]) { NSObject *stateItem = [state objectForKey:key]; [state setObject:[stateItem copy] forKey:key]; } [NSThread detachNewThreadSelector:@selector(serializeState:) toTarget:self withObject:state]; } - (void)archive { @synchronized (self.archiveTimer) { [self.archiveTimer invalidate]; if (self.archiveInterval > 0) { self.archiveTimer = [NSTimer scheduledTimerWithTimeInterval:[self archiveInterval] target:self selector:@selector(startArchiveThread:) userInfo:nil repeats:NO]; } self.wantsToArchive = YES; } } - (void)archiveNow { @synchronized (self.archiveTimer) { [self.archiveTimer invalidate]; [self startArchiveThread:nil]; [self archive]; } } /* removes every file in the cache directory */ - (void)invalidateAll { NSError *error; /* remove the cache directory and its contents */ if (![[NSFileManager defaultManager] removeItemAtPath: self.dataPath error: &error]) { NSLog(@ "Failed to remove cache contents at path: %@", self.dataPath); //return; If there was no old directory we for sure want a new one... } /* create a new cache directory */ if (![[NSFileManager defaultManager] createDirectoryAtPath: self.dataPath withIntermediateDirectories: NO attributes: nil error: &error]) { NSLog(@ "Failed to create new cache directory at path: %@", self.dataPath); return; // this is serious. we need this directory. } self.cachedItemInfos = [NSMutableDictionary dictionary]; self.urlRedirects = [NSMutableDictionary dictionary]; [self archive]; } - (NSString *)filenameForURL: (NSURL *) url { return [self filenameForURLString:[url absoluteString]]; } - (NSString *)filenameForURLString: (NSString *) URLString { #ifdef AFCACHE_MAINTAINER_WARNINGS #warning TODO cleanup #endif if ([URLString hasPrefix:@"data:"]) return nil; NSString *filepath = [URLString stringByRegex:@".*://" substitution:@""]; NSString *filepath1 = [filepath stringByRegex:@":[0-9]?*/" substitution:@""]; NSString *filepath2 = [filepath1 stringByRegex:@"#.*" substitution:@""]; NSString *filepath3 = [filepath2 stringByRegex:@"\?.*" substitution:@""]; NSString *filepath4 = [filepath3 stringByRegex:@"//*" substitution:@"/"]; if (self.cacheWithoutUrlParameter) { NSArray *comps = [filepath4 componentsSeparatedByString:@"?"]; if (comps) { filepath4 = [comps objectAtIndex:0]; } } if (self.cacheWithoutHostname) { NSMutableArray *pathComps = [NSMutableArray arrayWithArray:[filepath4 pathComponents]]; if (pathComps) { [pathComps removeObjectAtIndex:0]; return [NSString pathWithComponents:pathComps]; } } return filepath4; } - (NSString *)filePath: (NSString *) filename { return [self.dataPath stringByAppendingPathComponent: filename]; } - (NSString *)filePathForFilename:(NSString *)filename pathExtension:(NSString *)pathExtension { if (!pathExtension) { return [self filePath:filename]; } else { return [[self.dataPath stringByAppendingPathComponent:filename] stringByAppendingPathExtension:pathExtension]; } } - (NSString *)filePathForURL: (NSURL *) url { return [self.dataPath stringByAppendingPathComponent: [self filenameForURL: url]]; } - (NSString *)fullPathForCacheableItem:(AFCacheableItem*)item { if (!item) { return nil; } NSString *fullPath; if (!self.cacheWithHashname) { return [self filePathForURL:item.url]; } else { #if USE_ASSERTS NSAssert([item.info.filename length] > 0, @"Filename length MUST NOT be zero! This is a software bug"); #endif return [self filePathForFilename:item.info.filename pathExtension:[item.url pathExtension]]; } } - (void)removeCacheEntry:(AFCacheableItemInfo*)info fileOnly:(BOOL)fileOnly { [self removeCacheEntry:info fileOnly:fileOnly fallbackURL:nil]; } - (void)removeCacheEntry:(AFCacheableItemInfo*)info fileOnly:(BOOL) fileOnly fallbackURL:(NSURL *)fallbackURL; { if (!info) { return; } // remove redirects to this entry for (id redirectKey in [self.urlRedirects allValues]) { if ([redirectKey isKindOfClass:[NSString class]]) { id redirectTarget = [self.urlRedirects objectForKey:redirectKey]; if ([redirectTarget isKindOfClass:[NSString class]]) { if([redirectTarget isEqualToString:[info.request.URL absoluteString]]) { [self.urlRedirects removeObjectForKey:redirectKey]; } } } } NSString *filePath = nil; if (!self.cacheWithHashname) { filePath = [self filePathForURL:info.request.URL]; } else { if (fallbackURL) { filePath = [self filePathForFilename:info.filename pathExtension:[fallbackURL pathExtension]]; } else { filePath = [self filePathForFilename:info.filename pathExtension:[info.request.URL pathExtension]]; } } BOOL fileNonExistentOrDeleted = [self deleteFileAtPath:filePath]; if (!fileOnly && (fileNonExistentOrDeleted)) { if (fallbackURL) { [self.cachedItemInfos removeObjectForKey:[fallbackURL absoluteString]]; } else { NSURL* requestURL = [info.request URL]; if (requestURL) { [self.cachedItemInfos removeObjectForKey:[requestURL absoluteString]]; } } } } -(void)removeCacheEntryAndFileForFileURL:(NSURL*)fileURL { NSSet* results = [self.cachedItemInfos keysOfEntriesPassingTest:^BOOL(id key, id evaluatedObject, BOOL *stop) { if ([evaluatedObject isKindOfClass:[AFCacheableItemInfo class]]) { return [((AFCacheableItemInfo*)evaluatedObject).filename isEqualToString:[[fileURL lastPathComponent] stringByDeletingPathExtension]]; } return NO; }]; if ([results count] > 0) { //delete file and entry for files with corresponding infos (should only be one) for (NSString* key in results) { AFCacheableItemInfo* info = self.cachedItemInfos[key]; [self removeCacheEntry:info fileOnly:NO fallbackURL:[NSURL URLWithString:key]]; } } else { NSError* error = nil; if(![[NSFileManager defaultManager] removeItemAtURL:fileURL error: &error]) { NSLog(@"WARNING: failed to delete orphaned cache file at %@ with error : %@", fileURL, error); } } } -(BOOL)deleteFileAtPath:(NSString*)filePath { BOOL successfullyDeletedFile = NO; BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:filePath]; NSError* error = nil; if (fileExists) { successfullyDeletedFile = [[NSFileManager defaultManager] removeItemAtPath: filePath error: &error]; if (!successfullyDeletedFile) { AFLog(@ "Failed to delete file for outdated cache item info %@", info); NSLog(@"ERROR: failed to delete file %@ because of error: %@", filePath, error); } else { AFLog(@ "Successfully removed item at %@", filePath); } } return (!fileExists) || successfullyDeletedFile; } #pragma mark internal core methods - (void)updateModificationDataAndTriggerArchiving: (AFCacheableItem *) cacheableItem { NSError *error = nil; NSString *filePath = [self fullPathForCacheableItem:cacheableItem]; /* reset the file's modification date to indicate that the URL has been checked */ NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSDate date], NSFileModificationDate, nil]; if (![[NSFileManager defaultManager] setAttributes:dict ofItemAtPath:filePath error:&error]) { NSLog(@ "Failed to reset modification date for cache item %@", filePath); } [self archive]; } - (NSOutputStream*)createOutputStreamForItem:(AFCacheableItem*)cacheableItem { NSString *filePath = [self fullPathForCacheableItem: cacheableItem]; // remove file if exists if ([[NSFileManager defaultManager] fileExistsAtPath: filePath]) { [self removeCacheEntry:cacheableItem.info fileOnly:YES]; AFLog(@"removing %@", filePath); } // create directory if not exists NSString *pathToDirectory = [filePath stringByDeletingLastPathComponent]; BOOL isDirectory = YES; if (![[NSFileManager defaultManager] fileExistsAtPath:pathToDirectory isDirectory:&isDirectory] || !isDirectory) { NSError* error = nil; if (!isDirectory) { if (![[NSFileManager defaultManager] removeItemAtPath:pathToDirectory error:&error]) { NSLog(@"AFCache: Could not remove directory \"%@\" (Error: %@)", pathToDirectory, [error localizedDescription]); } } if ( [[NSFileManager defaultManager] createDirectoryAtPath:pathToDirectory withIntermediateDirectories:YES attributes:nil error:&error]) { AFLog(@"creating directory %@", pathToDirectory); [AFCache addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:pathToDirectory]]; } else { AFLog(@"Failed to create directory at path %@", pathToDirectory); } } // write file if (self.maxItemFileSize == kAFCacheInfiniteFileSize || cacheableItem.info.contentLength < self.maxItemFileSize) { /* file doesn't exist, so create it */ #if TARGET_OS_IPHONE NSDictionary *fileAttributes = @{NSFileProtectionKey:NSFileProtectionNone}; #else NSDictionary *fileAttributes = nil; #endif if (![[NSFileManager defaultManager] createFileAtPath:filePath contents:nil attributes:fileAttributes]) { AFLog(@"Error: could not create file \"%@\"", filePath); } NSURL *fileURL = [NSURL fileURLWithPath:filePath]; [AFCache addSkipBackupAttributeToItemAtURL:fileURL]; NSOutputStream *outputStream = [[NSOutputStream alloc] initWithURL:fileURL append:NO]; [outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; [outputStream open]; return outputStream; } else { NSLog(@ "AFCache: item %@ \nsize exceeds maxItemFileSize (%f). Won't write file to disk",cacheableItem.url, self.maxItemFileSize); [self.cachedItemInfos removeObjectForKey: [cacheableItem.url absoluteString]]; return nil; } } - (BOOL)_fileExistsOrPendingForCacheableItem:(AFCacheableItem*)item { if (![self isValidRequestURL:item.url]) { return NO; } // the complete path NSString *filePath = [self fullPathForCacheableItem:item]; AFLog(@"checking for file at path %@", filePath); if (![[NSFileManager defaultManager] fileExistsAtPath: filePath]) { // file doesn't exist. check if someone else is downloading the url already if ([self isQueuedOrDownloadingURL:item.url]) { AFLog(@"Someone else is already downloading the URL: %@.", [item.url absoluteString]); } else { AFLog(@"Cache miss for URL: %@.", [item.url absoluteString]); return NO; } } return YES; } // If the file exists on disk we return a new AFCacheableItem for it, // but it may be only half loaded yet. - (AFCacheableItem *)cacheableItemFromCacheStore: (NSURL *) URL { if (![self isValidRequestURL:URL]) { return nil; } if ([[URL absoluteString] hasPrefix:@"data:"]) { return nil; } AFCacheableItemInfo *info = [self.cachedItemInfos objectForKey: [URL absoluteString]]; if (!info) { NSString *redirectURLString = [self.urlRedirects valueForKey:[URL absoluteString]]; info = [self.cachedItemInfos objectForKey: redirectURLString]; } if (!info) { return nil; } AFLog(@"Cache hit for URL: %@", [URL absoluteString]); // check if there is an item in pendingConnections AFCacheableItem *cacheableItem; AFDownloadOperation *downloadOperation = [self nonCancelledDownloadOperationForURL:URL]; if ([downloadOperation isExecuting]) { // TODO: This concept of AFCache was broken: Returning a running download request does not conform to this method's name cacheableItem = downloadOperation.cacheableItem; } else { cacheableItem = [[AFCacheableItem alloc] init]; cacheableItem.cache = self; cacheableItem.url = URL; cacheableItem.info = info; cacheableItem.currentContentLength = 0;//info.contentLength; if (!self.cacheWithHashname) { cacheableItem.info.filename = [self filenameForURL:cacheableItem.url]; } // check if file is valid /* ======> * * This is the place where we check if the URL is already in the queue * * TODO: Remove comment as soon as all that internal method got cleaned up * * <====== */ BOOL fileExistsOrPending = [self _fileExistsOrPendingForCacheableItem:cacheableItem]; if (!fileExistsOrPending) { // Something went wrong AFLog(@"Cache info store out of sync for url %@, removing cached file %@.", [URL absoluteString], [self fullPathForCacheableItem:cacheableItem]); // TODO: The concept is broken here. Why are we going to delete a file that obviously DOES NOT EXIST? maybe it makes sense when the url is pending? [self removeCacheEntry:cacheableItem.info fileOnly:YES]; cacheableItem = nil; } else { //make sure that we continue downloading by setting the length (currently done by reading out file lenth in the info.actualLength accessor) cacheableItem.info.cachePath = [self fullPathForCacheableItem:cacheableItem]; } } // Update item's status if ([self offlineMode]) { cacheableItem.cacheStatus = kCacheStatusFresh; } else if (cacheableItem.isRevalidating) { cacheableItem.cacheStatus = kCacheStatusRevalidationPending; } else if (nil != cacheableItem.data || !cacheableItem.canMapData) { cacheableItem.cacheStatus = [cacheableItem isFresh] ? kCacheStatusFresh : kCacheStatusStale; } return cacheableItem; } #pragma mark - Cancel requests on cache - (void)cancelAllRequestsForURL:(NSURL *)url { if (!url) { return; } for (AFDownloadOperation *downloadOperation in [self.downloadOperationQueue operations]) { if ([[downloadOperation.cacheableItem.url absoluteString] isEqualToString:[url absoluteString]]) { [downloadOperation cancel]; } } } - (void)cancelAsynchronousOperationsForURL:(NSURL *)url itemDelegate:(id)itemDelegate { if (!url || !itemDelegate) { return; } for (AFDownloadOperation *downloadOperation in [self.downloadOperationQueue operations]) { if ((downloadOperation.cacheableItem.delegate == itemDelegate) && ([[downloadOperation.cacheableItem.url absoluteString] isEqualToString:[url absoluteString]])) { [downloadOperation cancel]; } } } - (void)cancelAsynchronousOperationsForDelegate:(id)itemDelegate { if (!itemDelegate) { return; } for (AFDownloadOperation *downloadOperation in [self.downloadOperationQueue operations]) { if (downloadOperation.cacheableItem.delegate == itemDelegate) { [downloadOperation cancel]; } } } - (void)cancelAllDownloads { [self.downloadOperationQueue cancelAllOperations]; } - (BOOL)isQueuedURL:(NSURL*)url { AFDownloadOperation *downloadOperation = [self nonCancelledDownloadOperationForURL:url]; return downloadOperation && !([downloadOperation isExecuting] || [downloadOperation isFinished]); } - (void)prioritizeURL:(NSURL*)url { [[self nonCancelledDownloadOperationForURL:url] setQueuePriority:NSOperationQueuePriorityVeryHigh]; } /** * Add the item to the downloadQueue */ - (void)addItemToDownloadQueue:(AFCacheableItem*)item { if ([self offlineMode]) { [item sendFailSignalToClientItems]; return; } //check if we can download if (![item.url isFileURL] && [self offlineMode]) { //we can not download this item at the moment [item sendFailSignalToClientItems]; return; } // check if we are downloading already if ([self isDownloadingURL: item.url]) { // don't start another connection AFLog(@"We are downloading already. Won't start another connection for %@", item.url); return; } NSURLRequest *theRequest = item.info.request; // no original request, check if we want to send an IMS request if (!theRequest) { theRequest = item.IMSRequest; } // this is a reqular request, create a new one if (!theRequest) { NSTimeInterval timeout = item.isPackageArchive ? self.networkTimeoutIntervals.PackageRequest : self.networkTimeoutIntervals.GETRequest; theRequest = [NSMutableURLRequest requestWithURL: item.url cachePolicy: NSURLRequestReloadIgnoringLocalCacheData timeoutInterval: timeout]; } if ([theRequest isKindOfClass:[NSMutableURLRequest class]]) { #ifdef RESUMEABLE_DOWNLOAD uint64_t dataAlreadyDownloaded = item.info.actualLength; NSString* rangeToDownload = [NSString stringWithFormat:@"%lld-",dataAlreadyDownloaded]; uint64_t expectedFileSize = item.info.contentLength; if(expectedFileSize > 0) rangeToDownload = [rangeToDownload stringByAppendingFormat:@"%lld",expectedFileSize]; AFLog(@"range %@",rangeToDownload); [(NSMutableURLRequest*)theRequest setValue:rangeToDownload forHTTPHeaderField:@"Range"]; #endif [(NSMutableURLRequest*)theRequest setValue:@"" forHTTPHeaderField:AFCacheInternalRequestHeader]; } item.info.requestTimestamp = [NSDate timeIntervalSinceReferenceDate]; item.info.responseTimestamp = 0.0; item.info.request = theRequest; ASSERT_NO_CONNECTION_WHEN_IN_OFFLINE_MODE_FOR_URL(theRequest.URL); AFDownloadOperation *downloadOperation = [[AFDownloadOperation alloc] initWithCacheableItem:item]; [self.downloadOperationQueue addOperation:downloadOperation]; } - (BOOL)hasCachedItemForURL:(NSURL *)url { AFCacheableItem* item = [self cacheableItemFromCacheStore:url]; if (item) { return nil != item.data; } return NO; } #pragma mark - offline mode & pause methods - (BOOL)suspended { return [self.downloadOperationQueue isSuspended]; } - (void)setSuspended:(BOOL)pause { [self.downloadOperationQueue setSuspended:pause]; [self.packageArchiveQueue setSuspended:pause]; // TODO: Do we really need to cancel already running downloads? If not, just remove the following lines if (pause) { // TODO: Cancel current downloads and add running download operations to a list... } else { // TODO: ...whose items are now added back to the queue with highest priority to start downloading them again } } /* * Returns whether we currently have a working connection * Note: This should be done asynchronously, i.e. use * SCNetworkReachabilityScheduleWithRunLoop and let it update our information. */ - (BOOL)isConnectedToNetwork { // Create zero address struct sockaddr_in zeroAddress; bzero( &zeroAddress, sizeof(zeroAddress) ); zeroAddress.sin_len = sizeof(zeroAddress); zeroAddress.sin_family = AF_INET; // Recover reachability flags SCNetworkReachabilityRef defaultRouteReachability = SCNetworkReachabilityCreateWithAddress(NULL, (struct sockaddr *)&zeroAddress); SCNetworkReachabilityFlags flags; BOOL didRetrieveFlags = SCNetworkReachabilityGetFlags(defaultRouteReachability, &flags); CFRelease(defaultRouteReachability); if (!didRetrieveFlags) { //NSLog(@"Error. Could not recover network reachability flags\n"); return 0; } BOOL isReachable = (flags & kSCNetworkFlagsReachable) == kSCNetworkFlagsReachable; BOOL needsConnection = (flags & kSCNetworkFlagsConnectionRequired) == kSCNetworkFlagsConnectionRequired; return isReachable && !needsConnection; } - (void)setConnectedToNetwork:(BOOL)connected { if (_connectedToNetwork != connected) { [self willChangeValueForKey:@"connectedToNetwork"]; _connectedToNetwork = connected; [self didChangeValueForKey:@"connectedToNetwork"]; } } #pragma mark - Helper /** * @return is that url valid to be requested */ - (BOOL)isValidRequestURL:(NSURL*)url { // url should not be nil nor having a zero length, also it must have a scheme return [[url absoluteString] length] > 0 && [[url scheme] length] > 0; } /** * */ - (void)handleInvalidURLRequest:(AFCacheableItemBlock)failBlock { NSError *error = [NSError errorWithDomain:@"URL is not set" code:-1 userInfo:nil]; AFCacheableItem *item = [[AFCacheableItem alloc] init]; item.error = error; if (failBlock) { failBlock(item); } } #pragma mark helper -(NSString *)infoDictionaryPath { return [self.dataPath stringByAppendingPathComponent: kAFCachePackageInfoDictionaryFilename]; } -(NSString *)metaDataDictionaryPath { return [self.dataPath stringByAppendingPathComponent: kAFCacheMetadataFilename]; } -(NSString *)expireInfoDictionaryPath { return [self.dataPath stringByAppendingPathComponent: kAFCacheExpireInfoDictionaryFilename]; } #pragma mark migration -(NSString *)version { if (!_version) { _version = [SPVIVersionIntrospection sharedIntrospection].versionsForDependency[@"AFCache"]; if (!_version) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ NSLog(@"ERROR: could not get current version of AFCache"); }); } } return _version; } -(BOOL)migrateFromVersion:(NSString*)version { NSString* currentVersion = self.version; if (!currentVersion) { return NO; } if (!version || [version length] == 0) { if ([currentVersion hasPrefix:@"0.11."]) { return [self migrateFromUnversionedToZeroDotEleven]; } else { NSLog(@"ERROR: unsupportedMigration from %@ to %@", version ?: @"unknown", currentVersion); } } else { if ([version isEqualToString:currentVersion]) { //no migration necessary return YES; } if ([version hasPrefix:@"0.11."] && [currentVersion hasPrefix:@"0.11."]) { //no migration should be necessary return YES; } NSLog(@"WARNING: we don't have a migration for %@ of AFCache, this might lead to problems", version); } return NO; } -(BOOL)migrateFromUnversionedToZeroDotEleven { // unknown => 0.11 [self performBlockOnAllCacheFiles:^(NSURL *url) { [AFCache addSkipBackupAttributeToItemAtURL:url]; }]; return YES; } @end #pragma mark - additional implementations #ifdef USE_ENGINEROOM #import #endif @implementation AFCache( LoggingSupport ) + (void) setLoggingEnabled: (BOOL) enabled { #ifdef USE_ENGINEROOM if( enabled ) { ER_ADDRESS_OF_GLOBAL_OR_EMBEDDED( logPointEnableSimple )("AFCache"); } else { ER_ADDRESS_OF_GLOBAL_OR_EMBEDDED( logPointDisableSimple )("AFCache"); } lpkdebugf("AFCache", "using %s", ER_ADDRESS_OF_GLOBAL_OR_EMBEDDED( logPointLibraryIdentifier )() ); #else AFLog(@"AFCache setLoggingEnabled: ignored (EngineRoom not embedded)"); #endif } + (void) setLogFormat: (NSString *) logFormat { #ifdef USE_ENGINEROOM if( NULL == logPointSetLogFormat ) { ER_ADDRESS_OF_GLOBAL_OR_EMBEDDED( logPointSetLogFormat )( [logFormat UTF8String] ); } else { lpkdebugf("AFCache", "%s", "ignored (using non-embedded EngineRoom)"); } #else AFLog(@"AFCache setLogFormat: ignored (EngineRoom not embedded)"); #endif } @end @implementation AFCache( BLOCKS ) - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url completionBlock: (AFCacheableItemBlock)aCompletionBlock failBlock: (AFCacheableItemBlock)aFailBlock options: (int) options { return [self cachedObjectForURL: url completionBlock: aCompletionBlock failBlock: aFailBlock options: options userData: nil username: nil password: nil]; } - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url completionBlock: (AFCacheableItemBlock)aCompletionBlock failBlock: (AFCacheableItemBlock)aFailBlock options: (int) options userData: (id)userData username: (NSString *)aUsername password: (NSString *)aPassword { AFCacheableItem *item = [self cachedObjectForURL:url delegate:nil selector:nil didFailSelector:nil completionBlock:aCompletionBlock failBlock:aFailBlock progressBlock:nil options:options userData:userData username:aUsername password:aPassword request:nil]; return item; } - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url completionBlock: (AFCacheableItemBlock)aCompletionBlock failBlock: (AFCacheableItemBlock)aFailBlock progressBlock: (AFCacheableItemBlock)aProgressBlock options: (int) options userData: (id)userData username: (NSString *)aUsername password: (NSString *)aPassword { AFCacheableItem *item = [self cachedObjectForURL:url delegate:nil selector:nil didFailSelector: nil completionBlock:aCompletionBlock failBlock:aFailBlock progressBlock:aProgressBlock options:options userData:userData username:aUsername password:aPassword request:nil]; return item; } - (AFCacheableItem *)cachedObjectForURL: (NSURL *) url completionBlock: (AFCacheableItemBlock)aCompletionBlock failBlock: (AFCacheableItemBlock)aFailBlock progressBlock: (AFCacheableItemBlock)aProgressBlock options: (int) options { return [self cachedObjectForURL: url completionBlock: aCompletionBlock failBlock: aFailBlock progressBlock: aProgressBlock options: options userData: nil username: nil password: nil]; } @end ================================================ FILE: src/shared/AFCachePackageCreator.h ================================================ // // AFCachePackageCreator.h // AFCache // // Created by Michael Markowski on 22.03.12. // Copyright (c) 2012 Artifacts - Fine Software Development. All rights reserved. // #import #import "AFCache.h" #import "AFCacheableItem.h" #import "AFCache+Packaging.h" #import "AFCacheableItem+Packaging.h" #define kPackagerOptionResourcesFolder @"folder" #define kPackagerOptionBaseURL @"baseurl" #define kPackagerOptionMaxAge @"maxage" #define kPackagerOptionMaxItemFileSize @"maxItemFileSize" #define kPackagerOptionLastModifiedMinus @"lastmodifiedminus" #define kPackagerOptionLastModifiedPlus @"lastmodifiedplus" #define kPackagerOptionOutputFormatJSON @"json" #define kPackagerOptionOutputFilename @"outfile" #define kPackagerOptionIncludeAllFiles @"a" #define kPackagerOptionUserDataFolder @"userdata" #define kPackagerOptionUserDataKey @"userdatakey" #define kPackagerOptionFileToURLMap @"FileToURLMap" @interface AFCachePackageCreator : NSObject - (AFCacheableItem*)newCacheableItemForFileAtPath:(NSString*)filepath lastModified:(NSDate*)lastModified baseURL:(NSString*)baseURL maxAge:(NSNumber*)maxAge baseFolder:(NSString*)folder; - (BOOL)createPackageWithOptions:(NSDictionary*)options error:(NSError**)inError; @end ================================================ FILE: src/shared/AFCachePackageCreator.m ================================================ // // AFCachePackageCreator.m // AFCache // // Created by Michael Markowski on 22.03.12. // Copyright (c) 2012 Artifacts - Fine Software Development. All rights reserved. // #import "AFCachePackageCreator.h" #import "ZipArchive.h" #define kDefaultMaxItemFileSize kAFCacheInfiniteFileSize @implementation AFCachePackageCreator /* ================================================================================================ * Create a new AFCacheableItem with file at path and a given last modification data * ================================================================================================ */ - (AFCacheableItem*)newCacheableItemForFileAtPath:(NSString*)filepath lastModified:(NSDate*)lastModified baseURL:(NSString*)baseURL maxAge:(NSNumber*)maxAge baseFolder:(NSString*)folder { NSURL *url; NSString* escapedUrlString = [AFCacheableItem urlEncodeValue:filepath]; if (baseURL) { url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", baseURL, escapedUrlString]]; } else { url = [NSURL URLWithString:[NSString stringWithFormat:@"afcpkg://localhost/%@", escapedUrlString]]; } NSDate *expireDate = nil; if (maxAge) { NSTimeInterval seconds = [maxAge doubleValue]; expireDate = [lastModified dateByAddingTimeInterval:seconds]; } NSString *completePathToFile = [NSString stringWithFormat:@"%@/%@", folder, filepath]; AFCacheableItem *item = [[AFCacheableItem alloc] initWithURL:url lastModified:lastModified expireDate:expireDate]; NSData *data = [NSData dataWithContentsOfMappedFile:completePathToFile]; [item setDataAndFile:data]; return item; } - (void)enumerateFilesInFolder:(NSString*)aFolder processHiddenFiles:(BOOL)processHiddenFiles usingBlock:(void (^)(NSString *file, NSDictionary *fileAttributes))block { NSFileManager *localFileManager=[[NSFileManager alloc] init]; // A directory enumarator for iterating through a folder's files NSDirectoryEnumerator *dirEnum = [localFileManager enumeratorAtPath:aFolder]; // write meta descriptions for (NSString *file in dirEnum) { // Create an inner autorelease pool, because we will create many objects in a loop @autoreleasepool { NSDictionary *attributes = [dirEnum fileAttributes]; NSString *fileType = [attributes objectForKey:NSFileType]; BOOL hidden = [[file lastPathComponent] hasPrefix:@"."] || ([file rangeOfString:@"/."].location!=NSNotFound); if ([fileType isEqualToString:NSFileTypeRegular]) { if (!hidden || processHiddenFiles) { block(file, attributes); } } } } } /* ================================================================================================ * Create AFCache Package with given commandline args * ================================================================================================ */ - (BOOL)createPackageWithOptions:(NSDictionary*)options error:(NSError**)inError { NSError *error = *inError; NSString *folder; NSString *baseURL; NSNumber *maxAge; NSTimeInterval lastModifiedOffset; BOOL success = YES; // folder containing resources folder = [options valueForKey:kPackagerOptionResourcesFolder]; // base url, e.g. http://www.foo.bar (WITHOUT trailig slash) baseURL = [options valueForKey:kPackagerOptionBaseURL]; if ([baseURL hasSuffix:@"/"]) { baseURL = [baseURL substringToIndex:[baseURL length] -1]; } // max-age in seconds maxAge = [NSNumber numberWithDouble:[[options valueForKey:kPackagerOptionMaxAge] doubleValue]]; // Maximum filesize of a cacheable item. Default is unlimited. double maxItemFileSize = [[options valueForKey:kPackagerOptionMaxItemFileSize] doubleValue]; if (maxItemFileSize == 0) { maxItemFileSize = kDefaultMaxItemFileSize; } #if MAINTAINER_WARNINGS #warning not good to change the max item file size in the cache singleton then calling this method! #endif [AFCache sharedInstance].maxItemFileSize = maxItemFileSize; // add n seconds to file's lastmodfied date if ([[options valueForKey:kPackagerOptionLastModifiedMinus] doubleValue] > 0) { lastModifiedOffset = -1 * [[options valueForKey:kPackagerOptionLastModifiedMinus] doubleValue]; } // substract n seconds from file's lastmodfied date if ([[options valueForKey:kPackagerOptionLastModifiedPlus] doubleValue] > 0) { lastModifiedOffset = [[options valueForKey:kPackagerOptionLastModifiedPlus] doubleValue]; } // write manifest file in json format (just for testing purposes) NSString *json = [options valueForKey:kPackagerOptionOutputFormatJSON]; // include all files. By default, files starting with a dot are excluded. NSString *addAllFiles = [options valueForKey:kPackagerOptionIncludeAllFiles]; // output filename NSString *outfile = [options valueForKey:kPackagerOptionOutputFilename]; // Folder containing arbitrary user data (will be accesible via userDataPathForPackageArchiveKey: in AFCache+Packaging.m NSString *userDataFolder = [options valueForKey:kPackagerOptionUserDataFolder]; // Key under which userdata can be accessed. Default is no key. NSString *userDataKey = [options valueForKey:kPackagerOptionUserDataKey]; NSDictionary *fileToURLMap = [options valueForKey:kPackagerOptionFileToURLMap]; // Create ZIP archive __block ZipArchive *zip = [[ZipArchive alloc] init]; NSMutableString *result = [[NSMutableString alloc] init]; @try { if (!folder) folder = @"."; // Create ZIP file or exit on error BOOL ret = [zip CreateZipFile2:(outfile)?outfile:@"afcache-archive.zip"]; if (!ret) { NSLog(@"Failed creating zip file.\n"); return NO; } // Exit if given folder containing data doesn't exist NSFileManager *localFileManager=[[NSFileManager alloc] init]; BOOL folderExists = [localFileManager fileExistsAtPath:folder]; if (!folderExists) { NSLog(@"Folder '%s' does not exist. Aborting.\n", [folder cStringUsingEncoding:NSUTF8StringEncoding]); return NO; } if (json) { [result appendFormat:@"{\n\"resources\":[\n"]; } BOOL processHiddenFiles = ([addAllFiles length] > 0)?YES:NO; __block NSMutableArray *metaDescriptions = [[NSMutableArray alloc] init]; [self enumerateFilesInFolder:folder processHiddenFiles:processHiddenFiles usingBlock: ^ (NSString *file, NSDictionary *fileAttributes) { NSDate *lastModificationDate = [fileAttributes objectForKey:NSFileModificationDate]; NSString *fileType = [fileAttributes objectForKey:NSFileType]; BOOL hidden = [[file lastPathComponent] hasPrefix:@"."] || ([file rangeOfString:@"/."].location!=NSNotFound); if ([fileType isEqualToString:NSFileTypeRegular]) { if (!hidden || addAllFiles) { if (lastModifiedOffset != 0) { lastModificationDate = [lastModificationDate dateByAddingTimeInterval:lastModifiedOffset]; } AFCacheableItem *item = [self newCacheableItemForFileAtPath:file lastModified:lastModificationDate baseURL:baseURL maxAge:maxAge baseFolder:folder]; NSString *mappedURL = [fileToURLMap valueForKey:item.info.filename]; if (mappedURL) { item.url = [NSURL URLWithString:mappedURL]; } NSString *completePathToFile = [NSString stringWithFormat:@"%@/%@", folder, file]; NSLog(@"Adding %s\n", [item.info.filename cStringUsingEncoding:NSUTF8StringEncoding]); //, [file cStringUsingEncoding:NSUTF8StringEncoding]); [zip addFileToZip:completePathToFile newname:item.info.filename]; NSString *metaDescription = (json)?[item metaJSON]:[item metaDescription]; if (metaDescription) { [metaDescriptions addObject:metaDescription]; } } } }]; if ([userDataFolder length] > 0) { [self enumerateFilesInFolder:userDataFolder processHiddenFiles:processHiddenFiles usingBlock: ^ (NSString *file, NSDictionary *fileAttributes) { NSString *completePathToFile = [NSString stringWithFormat:@"%@/%@", userDataFolder, file]; NSString *userDataPath = ([userDataKey length] > 0)?[NSString stringWithFormat:@"%@/%@", kAFCacheUserDataFolder, userDataKey]:kAFCacheUserDataFolder; NSString *filePathInZip = [NSString stringWithFormat:@"%@/%@", userDataPath, file]; printf("Adding userdata: %s\n", [filePathInZip cStringUsingEncoding:NSUTF8StringEncoding]); [zip addFileToZip:completePathToFile newname:filePathInZip]; }]; } if ([metaDescriptions count] == 0 && [userDataFolder length] == 0) { printf("No input files. Aborting.\n"); return NO; } [result appendFormat:@"baseURL = %@\n", baseURL]; // write meta descriptions into result string NSUInteger i = [metaDescriptions count]; for (NSString *desc in metaDescriptions) { if (json) { [result appendString:@"\t"]; } [result appendFormat:@"%@", desc]; if (json && i>1) { [result appendString:@",\n"]; } i--; } if (json) { [result appendString: @"]\n}"]; } i++; } @catch (NSException * e) { NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[e description] forKey:NSLocalizedDescriptionKey]; error = [NSError errorWithDomain:@"AFCache" code:99 userInfo:userInfo]; return NO; } // create manifest tmp file const char *template = (char*)[[NSTemporaryDirectory() stringByAppendingPathComponent:@"AFCache.XXXXXX"] UTF8String]; char *buffer = strdup(template); mktemp(buffer); NSString *manifestPath = [NSString stringWithFormat:@"%s", buffer]; free(buffer); BOOL ok = [result writeToFile:manifestPath atomically:YES encoding:NSASCIIStringEncoding error:&error]; if (!ok) { NSDictionary *userInfo = [NSDictionary dictionaryWithObject: [NSString stringWithFormat: @"Error writing file at %s\n%@", [manifestPath cStringUsingEncoding:NSUTF8StringEncoding], [error localizedFailureReason]] forKey:NSLocalizedDescriptionKey]; error = [NSError errorWithDomain:@"AFCache" code:0 userInfo:userInfo]; return NO; } [zip addFileToZip:manifestPath newname:@"manifest.afcache"]; // cleanup [[NSFileManager defaultManager] removeItemAtPath:manifestPath error:&error]; bailout: return success; } @end ================================================ FILE: src/shared/AFCache_Logging.h ================================================ /* * AFCache_Logging.h * AFCache * * Created by Michael Markowski on 08.02.11. * Copyright 2011 Artifacts - Fine Software Development. All rights reserved. * */ #ifdef AFCACHE_LOGGING_ENABLED #define AFLog(fmt, ...) NSLog((fmt), ## __VA_ARGS__) #else #define AFLog(fmt, ...) /* */ #endif #ifdef USE_ENGINEROOM // to use EngineRoom, include EngineRoom-OSX.xcodeproj in the // if we use EngineRoom we should log all the time #undef AFCACHE_LOGGING_ENABLED #define AFCACHE_LOGGING_ENABLED true #import // define an NSLog compatible macro which creates logpoints with keyword AFCache #define AFCacheLPLog(fmt, ...) ( (void) lplog_c_printf_v1( LOGPOINT_FLAGS_DEBUG | LOGPOINT_NSSTRING, "NSLog", "AFCache", kLogPointLabelNone, kLogPointFormatInfoNone, fmt, ## __VA_ARGS__ ) ) #define NSLog AFCacheLPLog #else #define AFCacheLPLog AFLog #endif ================================================ FILE: src/shared/AFCacheableItem+FileAttributes.h ================================================ // // AFCacheableItem+FileAttributes.h // AFCache // // Created by Sebastian Grimme on 17.05.16. // Copyright © 2016 Artifacts - Fine Software Development. All rights reserved. // #import extern const char* kAFCacheContentLengthFileAttribute; extern const char* kAFCacheDownloadingFileAttribute; @interface AFCacheableItem (FileAttributes) - (BOOL)hasDownloadFileAttribute; - (void)flagAsDownloadStartedWithContentLength:(uint64_t)contentLength; - (void)flagAsDownloadFinishedWithContentLength:(uint64_t)contentLength; - (uint64_t)getContentLengthFromFile; @end ================================================ FILE: src/shared/AFCacheableItem+FileAttributes.m ================================================ // // AFCacheableItem+FileAttributes.m // AFCache // // Created by Sebastian Grimme on 17.05.16. // Copyright © 2016 Artifacts - Fine Software Development. All rights reserved. // #import "AFCacheableItem+FileAttributes.h" #import "AFCache+PrivateAPI.h" #import "AFCache_Logging.h" #import "AFCacheableItem.h" #include const char* kAFCacheContentLengthFileAttribute = "de.artifacts.contentLength"; const char* kAFCacheDownloadingFileAttribute = "de.artifacts.downloading"; @implementation AFCacheableItem (FileAttributes) - (BOOL)hasDownloadFileAttribute { unsigned int downloading = 0; NSString *filePath = [self.cache fullPathForCacheableItem:self]; return sizeof(downloading) == getxattr([filePath fileSystemRepresentation], kAFCacheDownloadingFileAttribute, &downloading, sizeof(downloading), 0, 0); } - (void)flagAsDownloadStartedWithContentLength:(uint64_t)contentLength { NSString *filePath = [self.cache fullPathForCacheableItem:self]; if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]) { return; } if (0 != setxattr(filePath.fileSystemRepresentation, kAFCacheContentLengthFileAttribute, &contentLength, sizeof(uint64_t), 0, 0)) { AFLog(@"Could not set contentLength attribute on %@", self); } unsigned int downloading = 1; if (0 != setxattr(filePath.fileSystemRepresentation, kAFCacheDownloadingFileAttribute, &downloading, sizeof(downloading), 0, 0)) { AFLog(@"Could not set downloading attribute on %@", self); } } - (void)flagAsDownloadFinishedWithContentLength:(uint64_t)contentLength { NSString *filePath = [self.cache fullPathForCacheableItem:self]; if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]) { return; } if (0 != setxattr(filePath.fileSystemRepresentation, kAFCacheContentLengthFileAttribute, &contentLength, sizeof(uint64_t), 0, 0)) { AFLog(@"Could not set contentLength attribute on %@, errno = %ld", self, (long)errno ); } if (0 != removexattr(filePath.fileSystemRepresentation, kAFCacheDownloadingFileAttribute, 0)) { AFLog(@"Could not remove downloading attribute on %@, errno = %ld", self, (long)errno ); } } - (uint64_t)getContentLengthFromFile { if ([self isQueuedOrDownloading]) { return 0LL; } NSString *filePath = [self.cache fullPathForCacheableItem:self]; uint64_t realContentLength = 0LL; ssize_t const size = getxattr([filePath fileSystemRepresentation], kAFCacheContentLengthFileAttribute, &realContentLength, sizeof(realContentLength), 0, 0); if (sizeof(realContentLength) != size) { AFLog(@"Could not get content length attribute from file %@. This may be bad (errno = %ld", filePath, (long)errno); return 0LL; } return realContentLength; } @end ================================================ FILE: src/shared/AFCacheableItem+Packaging.h ================================================ // // AFCacheableItem+MetaDescription.h // AFCache // // Created by Michael Markowski on 16.07.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // #import #import "AFCacheableItem.h" @interface AFCacheableItem (Packaging) - (NSString*)metaDescription; - (NSString*)metaJSON; + (NSString *)urlEncodeValue:(NSString *)str; - (void)setDataAndFile:(NSData*)data; @end ================================================ FILE: src/shared/AFCacheableItem+Packaging.m ================================================ // // AFCacheableItem+MetaDescription.m // AFCache // // Created by Michael Markowski on 16.07.10. // Copyright 2010 Artifacts - Fine Software Development. All rights reserved. // #import "AFCacheableItem+Packaging.h" #import "AFCacheableItem+FileAttributes.h" #import "DateParser.h" #import "AFCache+PrivateAPI.h" @implementation AFCacheableItem (Packaging) - (NSString*)metaJSON { DateParser* dateParser = [[DateParser alloc] init]; NSString *filename = self.info.filename; DateParser *parser = [[DateParser alloc] init]; NSMutableString *metaDescription = [NSMutableString stringWithFormat:@"{\"url\": \"%@\",\n\"file\": \"%@\",\n\"last-modified\": \"%@\", valid until: %@", self.url, filename, [dateParser formatHTTPDate:self.info.lastModified], [dateParser formatHTTPDate:self.validUntil]]; if (self.validUntil) { [metaDescription appendFormat:@",\n\"expires\": \"%@\"", self.validUntil]; } [metaDescription appendFormat:@"\n}"]; return metaDescription; } - (NSString*)metaDescription { DateParser* dateParser = [[DateParser alloc] init]; if (self.validUntil) { // TODO: A getter is not supposed to modify internal states. This is unexpected. self.validUntil = self.info.lastModified; } NSMutableString *metaDescription = [NSMutableString stringWithFormat:@"%@ ; %@ ; %@ ; %@ ; %@", self.url, [dateParser formatHTTPDate:self.info.lastModified], self.validUntil?[dateParser formatHTTPDate:self.validUntil]:@"NULL", self.info.mimeType?:@"NULL", self.info.filename]; [metaDescription appendString:@"\n"]; return metaDescription; } + (NSString *)urlEncodeValue:(NSString *)str { CFStringRef preprocessedString =CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, (CFStringRef)str, CFSTR(""), kCFStringEncodingUTF8); CFStringRef urlString = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, preprocessedString, NULL, NULL, kCFStringEncodingUTF8); CFRelease(preprocessedString); return (__bridge NSString*)urlString; } - (void)setDataAndFile:(NSData*)data { self.data = data; self.info.contentLength = [data length]; // Store data into file NSOutputStream *outputStream = [self.cache createOutputStreamForItem:self]; if (outputStream.hasSpaceAvailable) { NSInteger bytesWritten = [outputStream write:data.bytes maxLength:data.length]; if (bytesWritten != data.length) { if ([self.delegate respondsToSelector:@selector(cannotWriteDataForItem:)]) { [self.delegate cannotWriteDataForItem:self]; } } } else { if ([self.delegate respondsToSelector:@selector(cannotWriteDataForItem:)]) { [self.delegate cannotWriteDataForItem:self]; } } [outputStream close]; [self flagAsDownloadFinishedWithContentLength:data.length]; } @end ================================================ FILE: src/shared/AFCacheableItem.h ================================================ /* * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Author: Michael Markowski (m.markowski@artifacts.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #if TARGET_OS_IPHONE #import #endif #import "AFCacheableItemInfo.h" #ifdef USE_TOUCHXML #import "TouchXML.h" #endif @class AFCache; @class AFCacheableItem; @protocol AFCacheableItemDelegate; enum AFCacheableItemStatus : NSUInteger { kCacheStatusNew = 0, kCacheStatusFresh = 1, // written into cacheableitem when item is fresh, either after fetching it for the first time or by revalidation. kCacheStatusModified = 2, // if ims request returns status 200 kCacheStatusNotModified = 4, kCacheStatusRevalidationPending = 5, kCacheStatusStale = 6, }; typedef void (^AFCacheableItemBlock)(AFCacheableItem* item); // TODO: Rename to AFCacheRequest @interface AFCacheableItem : NSObject @property (nonatomic, strong) NSURL *url; @property (nonatomic, strong) NSData *data; @property (nonatomic, strong) AFCache *cache; @property (nonatomic, weak) id delegate; @property (nonatomic, strong) NSError *error; /* validUntil holds the calculated expire date of the cached object. It is either equal to Expires (if Expires header is set), or the date based on the request time + max-age (if max-age header is set). If neither Expires nor max-age is given or if the resource must not be cached valitUntil is nil. */ @property (nonatomic, strong) NSDate *validUntil; @property (nonatomic, assign) BOOL justFetchHTTPHeader; @property (nonatomic, assign) enum AFCacheableItemStatus cacheStatus; @property (nonatomic, strong) AFCacheableItemInfo *info; @property (nonatomic, weak) id userData; @property (nonatomic, assign) BOOL isPackageArchive; @property (nonatomic, assign) uint64_t currentContentLength; /* Data for URL authentication */ @property (nonatomic, strong) NSURLCredential *urlCredential; @property (nonatomic, assign) BOOL isRevalidating; @property (nonatomic, readonly) BOOL canMapData; @property (nonatomic, strong) NSURLRequest *IMSRequest; @property (nonatomic, assign) BOOL servedFromCache; @property (nonatomic, assign) BOOL URLInternallyRewritten; // for debugging and testing purposes @property (nonatomic, assign) int tag; - (AFCacheableItem*)initWithURL:(NSURL*)URL lastModified:(NSDate*)lastModified expireDate:(NSDate*)expireDate contentType:(NSString*)contentType; - (AFCacheableItem*)initWithURL:(NSURL*)URL lastModified:(NSDate*)lastModified expireDate:(NSDate*)expireDate; // TODO: Move completionBlocks to AFDownloadOperation - (void)addCompletionBlock:(AFCacheableItemBlock)completionBlock failBlock:(AFCacheableItemBlock)failBlock progressBlock:(AFCacheableItemBlock)progressBlock; - (void)removeBlocks; - (void)sendFailSignalToClientItems; - (void)sendSuccessSignalToClientItems; - (void)sendProgressSignalToClientItems; - (BOOL) isDownloading; - (BOOL)isFresh; - (BOOL)isCachedOnDisk; - (NSString*)guessContentType; - (uint64_t)currentContentLength; - (BOOL)isComplete; - (BOOL)isDataLoaded; - (NSString *)asString; - (NSString*)mimeType __attribute__((deprecated)); // mimeType moved to AFCacheableItemInfo. // TODO: (Michael Markowski:) This method is implicitly guessing the mimetype which might be confusing because there's a property mimeType in AFCacheableItemInfo. #ifdef USE_TOUCHXML // TODO: This should be provided via a category - (CXMLDocument *)asXMLDocument; #endif - (BOOL)isDownloading; @end // TODO: AF(Debug)HTTPURLProtocol uses this delegate, but delegate methods are currently not called (any more). Elaborate on this. @protocol AFCacheableItemDelegate < NSObject > @optional - (void) connectionDidFail: (AFCacheableItem *) cacheableItem; - (void) connectionDidFinish: (AFCacheableItem *) cacheableItem; - (void) connectionHasBeenRedirected: (AFCacheableItem *) cacheableItem; - (void) packageArchiveDidReceiveData: (AFCacheableItem *) cacheableItem; - (void) packageArchiveDidFinishLoading: (AFCacheableItem *) cacheableItem; - (void) packageArchiveDidFinishExtracting: (AFCacheableItem *) cacheableItem; - (void) packageArchiveDidFailExtracting: (AFCacheableItem *) cacheableItem; - (void) packageArchiveDidFailLoading: (AFCacheableItem *) cacheableItem; - (void) cacheableItemDidReceiveData: (AFCacheableItem *) cacheableItem; - (void) cannotWriteDataForItem: (AFCacheableItem*)cacheableItem; @end ================================================ FILE: src/shared/AFCacheableItem.m ================================================ /* * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Author: Michael Markowski (m.markowski@artifacts.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #import "AFCacheableItem.h" #import "AFCacheableItem+FileAttributes.h" #import "AFCache+PrivateAPI.h" #import "AFCache_Logging.h" @interface AFCacheableItem () @property NSMutableArray *completionBlocks; @property NSMutableArray *failBlocks; @property NSMutableArray *progressBlocks; @property BOOL hasReturnedCachedItemBeforeRevalidation; @end @implementation AFCacheableItem - (instancetype)init { self = [super init]; if (self) { _data = nil; _canMapData = YES; _cacheStatus = kCacheStatusNew; _info = [[AFCacheableItemInfo alloc] init]; _IMSRequest = nil; _URLInternallyRewritten = NO; _completionBlocks = [NSMutableArray array]; _failBlocks = [NSMutableArray array]; _progressBlocks = [NSMutableArray array]; } return self; } - (AFCacheableItem*)initWithURL:(NSURL*)URL lastModified:(NSDate*)lastModified expireDate:(NSDate*)expireDate contentType:(NSString*)contentType { self = [self init]; if (self) { _info = [[AFCacheableItemInfo alloc] init]; _info.lastModified = lastModified; _info.expireDate = expireDate; _info.mimeType = contentType; _url = URL; _cacheStatus = kCacheStatusFresh; _validUntil = _info.expireDate; _cache = [AFCache sharedInstance]; } return self; } - (AFCacheableItem*)initWithURL:(NSURL*)URL lastModified:(NSDate*)lastModified expireDate:(NSDate*)expireDate { return [self initWithURL:URL lastModified:lastModified expireDate:expireDate contentType:nil]; } - (void)addCompletionBlock:(AFCacheableItemBlock)completionBlock failBlock:(AFCacheableItemBlock)failBlock progressBlock:(AFCacheableItemBlock)progressBlock { @synchronized (self) { if (completionBlock) { [self.completionBlocks addObject:completionBlock]; } if (failBlock) { [self.failBlocks addObject:failBlock]; } if (progressBlock) { [self.progressBlocks addObject:progressBlock]; } } } - (void)removeBlocks { @synchronized (self) { [self.completionBlocks removeAllObjects]; [self.failBlocks removeAllObjects]; [self.progressBlocks removeAllObjects]; } } - (void)performBlocks:(NSArray*)blocks { @synchronized (self) { blocks = [blocks copy]; } for (AFCacheableItemBlock block in blocks) { block(self); } } - (NSData*)data { if (!_data) { if (!self.cache.skipValidContentLengthCheck && ![self hasValidContentLength]) { return nil; } NSString* filePath = [self.cache fullPathForCacheableItem:self]; if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]) { return nil; } NSError* error = nil; _data = [NSData dataWithContentsOfFile:filePath options:NSDataReadingMappedIfSafe error:&error]; if (!_data) { NSLog(@"Error: Could not map file %@ because of error: %@", filePath, error); } _canMapData = (_data != nil); } return _data; } - (void)sendFailSignalToClientItems { if (self.isPackageArchive) { // TODO: Setting a status does not conform to method's name self.info.packageArchiveStatus = kAFCachePackageArchiveStatusLoadingFailed; } [self performBlocks:self.failBlocks]; } - (void)sendSuccessSignalToClientItems { if (self.isPackageArchive) { // TODO: Setting a status does not conform to method's name if (self.info.packageArchiveStatus == kAFCachePackageArchiveStatusUnknown) { self.info.packageArchiveStatus = kAFCachePackageArchiveStatusLoaded; } } [self performBlocks:self.completionBlocks]; } - (void)sendProgressSignalToClientItems { [self performBlocks:self.progressBlocks]; } /* * calculate freshness of object according to algorithm in rfc2616 * http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html * * age_value * is the value of Age: header received by the cache with this response. * date_value * is the value of the origin server's Date: header * request_time * is the (local) time when the cache made the request that resulted in this cached response * response_time * is the (local) time when the cache received the response * now * is the current (local) time */ - (BOOL)isFresh { #if USE_ASSERTS NSAssert(self.info!=nil, @"AFCache internal inconsistency detected while validating freshness. AFCacheableItem's info object must not be nil. This is a software bug."); #endif NSTimeInterval apparent_age = fmax(0, self.info.responseTimestamp - [self.info.serverDate timeIntervalSinceReferenceDate]); NSTimeInterval corrected_received_age = fmax(apparent_age, self.info.age); NSTimeInterval response_delay = (self.info.responseTimestamp>0)?self.info.responseTimestamp - self.info.requestTimestamp:0; // A zero (or negative) response delay indicates a transfer or connection error. // This happened when the archiever started between request start and response. if (response_delay < 0) { NSLog(@"WARNING: response_delay must never be negative!"); return NO; } NSTimeInterval corrected_initial_age = corrected_received_age + response_delay; NSTimeInterval resident_time = [NSDate timeIntervalSinceReferenceDate] - self.info.responseTimestamp; NSTimeInterval current_age = corrected_initial_age + resident_time; NSTimeInterval freshness_lifetime = 0; if (self.info.expireDate) { freshness_lifetime = [self.info.expireDate timeIntervalSinceReferenceDate] - [self.info.serverDate timeIntervalSinceReferenceDate]; } // The max-age directive takes priority over Expires! Thanks, Serge ;) if (self.info.maxAge) { freshness_lifetime = [self.info.maxAge doubleValue]; } // Note: // If none of Expires, Cache-Control: max-age, or Cache-Control: s- maxage (see section 14.9.3) appears in the response, // and the response does not include other restrictions on caching, the cache MAY compute a freshness lifetime using a heuristic. // The cache MUST attach Warning 113 to any response whose age is more than 24 hours if such warning has not already been added. BOOL fresh = (freshness_lifetime > current_age); AFLog(@"freshness_lifetime: %@", [NSDate dateWithTimeIntervalSinceReferenceDate: freshness_lifetime]); AFLog(@"current_age: %@", [NSDate dateWithTimeIntervalSinceReferenceDate: current_age]); return fresh; } - (BOOL)hasValidContentLength { NSString* filePath = [self.cache fullPathForCacheableItem:self]; if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]) { return NO; } NSError* err = nil; NSDictionary* attr = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:&err]; if (!attr) { AFLog(@"Error getting file attributes: %@", err); return NO; } uint64_t fileSize = [attr fileSize]; if (self.info.contentLength == 0 || fileSize != self.info.contentLength) { uint64_t realContentLength = [self getContentLengthFromFile]; if (realContentLength == 0 || realContentLength != fileSize) { return NO; } } return YES; } - (BOOL)isQueuedOrDownloading { return [self.cache isQueuedOrDownloadingURL:self.url]; } - (NSString *)asString { if (!self.data) return nil; return [[NSString alloc] initWithData: self.data encoding: NSUTF8StringEncoding]; } - (NSString*)description { NSMutableString *s = [NSMutableString stringWithString:@"URL: "]; [s appendString:[self.url absoluteString]]; [s appendString:@", "]; [s appendFormat:@"tag: %d", self.tag]; [s appendString:@", "]; [s appendFormat:@"cacheStatus: %u", self.cacheStatus]; [s appendString:@", "]; [s appendFormat:@"body content size: %ld\n", (long)[self.data length]]; [s appendString:[self.info description]]; [s appendString:@"\n"]; return s; } - (BOOL)isCachedOnDisk { return [self.cache.cachedItemInfos objectForKey: [self.url absoluteString]] != nil; } - (NSString*)guessContentType { NSString *extension = [self.url lastPathComponent]; return [self.cache.suffixToMimeTypeMap valueForKey:extension]; } - (NSString*)mimeType { if (!self.info.mimeType) { return [self guessContentType]; } return self.info.mimeType; } #ifdef USE_TOUCHXML - (CXMLDocument *)asXMLDocument { if (self.data == nil) return nil; NSError *err = nil; CXMLDocument *doc = [[[CXMLDocument alloc] initWithData: self.data options: 0 error: &err] autorelease]; return (err) ? nil : doc; } #endif - (BOOL)isComplete { //[[NSString alloc] initWithFormat:@"Item %@ has %lld of %lld data loaded, complete ? %d", self.info.filename, self.info.actualLength, self.info.contentLength,(self.currentContentLength >= self.info.contentLength)]; //assumed complete if there is data and the actual data length is at least as big as the expected content length. (should be exactly the expected content length but sometimes there is no expected content lenght present; self.info.contentLength = 0) return [self isDataLoaded] && (self.info.actualLength >= self.info.contentLength); } - (BOOL)isDataLoaded { return self.info.actualLength > 0; } -(uint64_t)currentContentLength{ return self.info.actualLength; } -(void)setCurrentContentLength:(uint64_t)contentLength { self.info.actualLength = contentLength; } - (BOOL)isDownloading { return [self.cache isDownloadingURL: self.url]; } @end ================================================ FILE: src/shared/AFCacheableItemInfo.h ================================================ /* * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Author: Michael Markowski (m.markowski@artifacts.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #import typedef enum { kAFCachePackageArchiveStatusUnknown = 0, kAFCachePackageArchiveStatusLoaded = 1, kAFCachePackageArchiveStatusConsumed = 2, kAFCachePackageArchiveStatusUnarchivingFailed = 3, kAFCachePackageArchiveStatusLoadingFailed = 4, } AFCachePackageArchiveStatus; @interface AFCacheableItemInfo : NSObject @property (nonatomic, assign) NSTimeInterval requestTimestamp; @property (nonatomic, assign) NSTimeInterval responseTimestamp; @property (nonatomic, strong) NSDate *lastModified; @property (nonatomic, strong) NSDate *serverDate; @property (nonatomic, assign) NSTimeInterval age; @property (nonatomic, copy) NSNumber *maxAge; @property (nonatomic, strong) NSDate *expireDate; @property (nonatomic, copy) NSString *eTag; @property (nonatomic, assign) NSUInteger statusCode; @property (nonatomic, assign) uint64_t contentLength; @property (nonatomic, assign) uint64_t actualLength; @property (nonatomic, copy) NSString *mimeType; @property (nonatomic, strong) NSDictionary *headers; @property (nonatomic, strong) NSURL *responseURL; // may differ from url when redirection or URL rewriting has occured. nil if URL has not been modified. @property (nonatomic, strong) NSURLRequest *request; @property (nonatomic, strong) NSURLResponse *response; @property (nonatomic, strong) NSURLRequest *redirectRequest; @property (nonatomic, strong) NSURLResponse *redirectResponse; @property (nonatomic, strong) NSString *filename; @property (nonatomic, strong) NSString *cachePath; @property (nonatomic, assign) AFCachePackageArchiveStatus packageArchiveStatus; @end ================================================ FILE: src/shared/AFCacheableItemInfo.m ================================================ /* * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Author: Michael Markowski (m.markowski@artifacts.de) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #import "AFCacheableItemInfo.h" #import "AFCache+PrivateAPI.h" @implementation AFCacheableItemInfo - (NSString*)newUniqueFilename { CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault); CFStringRef strRef = CFUUIDCreateString(kCFAllocatorDefault, uuidRef); NSString *uuidString = [[NSString alloc] initWithString:(__bridge NSString*)strRef]; CFRelease(strRef); CFRelease(uuidRef); return uuidString; } - (id)init { self = [super init]; if (self) { // TODO: We cannot assume that this item's cache is the default sharedInstance _filename = [AFCache sharedInstance].cacheWithHashname ? [self newUniqueFilename] : nil; } return self; } - (id)initWithCoder: (NSCoder *) coder { self = [super init]; if (self) { _requestTimestamp = [[coder decodeObjectForKey:@"requestTimestamp"] doubleValue]; _responseTimestamp = [[coder decodeObjectForKey:@"responseTimestamp"] doubleValue]; _serverDate = [coder decodeObjectForKey:@"serverDate"]; _lastModified = [coder decodeObjectForKey:@"lastModified"]; _age = [[coder decodeObjectForKey:@"age"] doubleValue]; _maxAge = [coder decodeObjectForKey:@"maxAge"]; _expireDate = [coder decodeObjectForKey:@"expireDate"]; _eTag = [coder decodeObjectForKey:@"eTag"]; _statusCode = [[coder decodeObjectForKey:@"statusCode"] unsignedIntegerValue]; _contentLength = [[coder decodeObjectForKey:@"contentLength"] unsignedIntValue]; _mimeType = [coder decodeObjectForKey:@"mimeType"]; _responseURL = [coder decodeObjectForKey:@"responseURL"]; _request = [coder decodeObjectForKey:@"request"]; _response = [coder decodeObjectForKey:@"response"]; _redirectRequest = [coder decodeObjectForKey:@"redirectRequest"]; _redirectResponse = [coder decodeObjectForKey:@"redirectResponse"]; _filename = [coder decodeObjectForKey:@"filename"]; _headers = [coder decodeObjectForKey:@"headers"]; } return self; } - (void)encodeWithCoder: (NSCoder *) coder { [coder encodeObject: [NSNumber numberWithDouble: self.requestTimestamp] forKey: @"requestTimestamp"]; [coder encodeObject: [NSNumber numberWithDouble: self.responseTimestamp] forKey: @"responseTimestamp"]; [coder encodeObject: self.serverDate forKey: @"serverDate"]; [coder encodeObject: self.lastModified forKey: @"lastModified"]; [coder encodeObject: [NSNumber numberWithDouble: self.age] forKey: @"age"]; [coder encodeObject: self.maxAge forKey: @"maxAge"]; [coder encodeObject: self.expireDate forKey: @"expireDate"]; [coder encodeObject: self.eTag forKey: @"eTag"]; [coder encodeObject: [NSNumber numberWithUnsignedInteger:self.statusCode] forKey: @"statusCode"]; [coder encodeObject: [NSNumber numberWithUnsignedLongLong:self.contentLength] forKey: @"contentLength"]; [coder encodeObject: self.mimeType forKey: @"mimeType"]; [coder encodeObject: self.responseURL forKey: @"responseURL"]; [coder encodeObject: self.request forKey: @"request"]; [coder encodeObject: self.response forKey: @"response"]; [coder encodeObject: self.redirectRequest forKey: @"redirectRequest"]; [coder encodeObject: self.redirectResponse forKey: @"redirectResponse"]; [coder encodeObject: self.filename forKey: @"filename"]; [coder encodeObject: self.headers forKey: @"headers"]; } - (NSString*)description { NSMutableString *s = [NSMutableString stringWithString:@"Cache information:\n"]; [s appendFormat:@"responseURL: %@\n", [self.responseURL absoluteString]]; [s appendFormat:@"requestTimestamp: %f\n", self.requestTimestamp]; [s appendFormat:@"responseTimestamp: %f\n", self.responseTimestamp]; [s appendFormat:@"serverDate: %@\n", [self.serverDate description]]; [s appendFormat:@"lastModified: %@\n", [self.lastModified description]]; [s appendFormat:@"age: %f\n", self.age]; [s appendFormat:@"maxAge: %@\n", self.maxAge]; [s appendFormat:@"expireDate: %@\n", [self.expireDate description]]; [s appendFormat:@"eTag: %@\n", self.eTag]; [s appendFormat:@"statusCode: %ld\n", (long)self.statusCode]; [s appendFormat:@"expectedContentLength: %ld\n", (long)self.contentLength]; [s appendFormat:@"currentContentLength: %ld\n", (long)self.actualLength]; [s appendFormat:@"mimeType: %@\n", self.mimeType]; [s appendFormat:@"request: %@\n", self.request]; [s appendFormat:@"response: %@\n", self.response]; [s appendFormat:@"redirectRequest: %@\n", self.redirectRequest]; [s appendFormat:@"redirectResponse: %@\n", self.redirectResponse]; [s appendFormat:@"filename: %@\n", self.filename]; [s appendFormat:@"packageArchiveStatus: %d\n", self.packageArchiveStatus]; [s appendFormat:@"headers: %d\n", self.headers]; return s; } -(uint64_t)actualLength { if(!_actualLength) { if(self.cachePath) { NSError* err = nil; NSDictionary* attr = [[NSFileManager defaultManager] attributesOfItemAtPath:self.cachePath error:&err]; if (attr == nil) { return 0; } uint64_t fileSize = [attr fileSize]; _actualLength = fileSize; } else { _actualLength = 0; } } return _actualLength; } @end ================================================ FILE: src/shared/AFDownloadOperation.h ================================================ // // AFDownloadOperation.h // AFCache // // Created by Sebastian Grimme on 28.07.14. // Copyright (c) 2014 Artifacts - Fine Software Development. All rights reserved. // #import @interface AFDownloadOperation : NSOperation @property(nonatomic, readonly) AFCacheableItem *cacheableItem; @property (nonatomic, readonly) BOOL isExecuting; @property (nonatomic, readonly) BOOL isFinished; - (instancetype)initWithCacheableItem:(AFCacheableItem*)cacheableItem; @end ================================================ FILE: src/shared/AFDownloadOperation.m ================================================ // // AFDownloadOperation.m // AFCache // // Created by Sebastian Grimme on 28.07.14. // Copyright (c) 2014 Artifacts - Fine Software Development. All rights reserved. // #import #import #import #import "AFDownloadOperation.h" #import "AFCache+PrivateAPI.h" #import "AFCache_Logging.h" #import "DateParser.h" @interface AFDownloadOperation () @property(nonatomic, strong) NSURLConnection *connection; @property(nonatomic, strong) NSOutputStream *outputStream; @end @implementation AFDownloadOperation - (instancetype)initWithCacheableItem:(AFCacheableItem *)cacheableItem { self = [super init]; if (self) { _cacheableItem = cacheableItem; _isExecuting = NO; _isFinished = NO; } return self; } - (void)dealloc { [_connection cancel]; } #pragma mark - Core NSOperation methods - (BOOL)isConcurrent { // I don't want NSOperationQueue to spawn a thread for me as my code needs to run on the main thread return YES; } - (BOOL)isAsynchronous { return YES; } - (void)start { // Do not execute cancelled operations if (self.isCancelled) { [self finish]; return; } // Always perform operation on main thread as NSURLConnection wants to be started on the main thread if (![NSThread isMainThread]) { [self performSelectorOnMainThread:@selector(start) withObject:nil waitUntilDone:NO]; return; } [self willChangeValueForKey:@"isExecuting"]; _isExecuting = YES; [self didChangeValueForKey:@"isExecuting"]; self.connection = [[NSURLConnection alloc] initWithRequest:self.cacheableItem.info.request delegate:self startImmediately:YES]; } - (void)finish { [self.connection cancel]; [self.outputStream close]; [self.outputStream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; [self willChangeValueForKey:@"isExecuting"]; [self willChangeValueForKey:@"isFinished"]; _isExecuting = NO; _isFinished = YES; [self didChangeValueForKey:@"isFinished"]; [self didChangeValueForKey:@"isExecuting"]; } #pragma mark - NSURLConnectionDelegate and NSURLConnectionDataDelegate methods /* * This method gives the delegate an opportunity to inspect the request that will be used to continue loading the * request, and modify it if necessary. The URL-change determinations mentioned above can occur as a result of * transforming a request URL to its canonical form, or can happen for protocol-specific reasons, such as an HTTP * redirect. */ - (NSURLRequest*)connection:(NSURLConnection*)connection willSendRequest:(NSURLRequest*)request redirectResponse:(NSURLResponse*)redirectResponse { NSMutableURLRequest *theRequest = [request mutableCopy]; if (self.cacheableItem.cache.userAgent) { [theRequest setValue:self.cacheableItem.cache.userAgent forHTTPHeaderField:@"User-Agent"]; } if (self.cacheableItem.justFetchHTTPHeader) { [theRequest setHTTPMethod:@"HEAD"]; } // TODO: Check if this redirect code is fine here, it seemed broken in the original place and I corrected it as I thought it should be if (redirectResponse && [request URL]) { self.cacheableItem.info.responseURL = [request URL]; self.cacheableItem.info.redirectRequest = request; self.cacheableItem.info.redirectResponse = redirectResponse; // TODO: Do not access #urlRedirects directly but provide access method [self.cacheableItem.cache.urlRedirects setValue:[self.cacheableItem.info.responseURL absoluteString] forKey:[self.cacheableItem.url absoluteString]]; } return theRequest; } /* * This method is called when the server has determined that it has enough information to create the NSURLResponse it * can be called multiple times, for example in the case of a redirect, so each time we reset the data. * * After the response headers are parsed, we try to load the object from disk. If the cached object is fresh, we call * connectionDidFinishLoading: with the cached object and cancel the original request. If the object is stale, we go on * with the request. */ - (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse*)response { self.cacheableItem.cache.connectedToNetwork = YES; if (self.isCancelled) { [self finish]; return; } [self handleResponse:response]; // call didFailSelector when statusCode >= 400 if (self.cacheableItem.cache.failOnStatusCodeAbove400 && self.cacheableItem.info.statusCode >= 400) { [self connection:connection didFailWithError:[NSError errorWithDomain:kAFCacheNSErrorDomain code:self.cacheableItem.info.statusCode userInfo:nil]]; return; } if (self.cacheableItem.validUntil) { // TODO: Do not expose #cachedItemInfos directly but provide access method [self.cacheableItem.cache.cachedItemInfos setObject: self.cacheableItem.info forKey: [self.cacheableItem.url absoluteString]]; } if (self.cacheableItem.justFetchHTTPHeader) { [self connectionDidFinishLoading:connection]; } } - (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data { if (self.isCancelled) { [self finish]; return; } if (self.outputStream.hasSpaceAvailable) { NSInteger bytesWritten = [self.outputStream write:data.bytes maxLength:data.length]; if (bytesWritten != data.length) { if ([self.cacheableItem.delegate respondsToSelector:@selector(cannotWriteDataForItem:)]) { [self.cacheableItem.delegate cannotWriteDataForItem:self.cacheableItem]; } [self finishWithError]; return; } } else { if ([self.cacheableItem.delegate respondsToSelector:@selector(cannotWriteDataForItem:)]) { [self.cacheableItem.delegate cannotWriteDataForItem:self.cacheableItem]; } [self finishWithError]; return; } self.cacheableItem.info.actualLength += [data length]; [self.cacheableItem sendProgressSignalToClientItems]; } /* * The connection did finish loading. Everything should be okay at this point. If so, store object into cache and call * delegate. If the server has not been delivered anything (response body is 0 bytes) we won't cache the response. */ - (void)connectionDidFinishLoading: (NSURLConnection *) connection { if (self.isCancelled) { [self finish]; return; } switch (self.cacheableItem.info.statusCode) { case 204: // No Content case 205: // Reset Content // TODO: case 206: Partial Content case 400: // Bad Request case 401: // Unauthorized case 402: // Payment Required case 403: // Forbidden case 404: // Not Found case 405: // Method Not Allowed case 406: // Not Acceptable case 407: // Proxy Authentication Required case 408: // Request Timeout case 409: // Conflict case 410: // Gone case 411: // Length Required case 412: // Precondition Failed case 413: // Request Entity Too Large case 414: // Request-URI Too Long case 415: // Unsupported Media Type case 416: // Requested Range Not Satisfiable case 417: // Expectation Failed case 500: // Internal Server Error case 501: // Not Implemented case 502: // Bad Gateway case 503: // Service Unavailable case 504: // Gateway Timeout case 505: // HTTP Version Not Supported break; default: { NSError *error = nil; if (!self.cacheableItem.url) { error = [NSError errorWithDomain:@"URL is nil" code:99 userInfo:nil]; } // Test for correct content length NSString *path = [self.cacheableItem.cache fullPathForCacheableItem:self.cacheableItem]; NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:path error:&error]; if (attr) { uint64_t fileSize = [attr fileSize]; if (fileSize != self.cacheableItem.info.contentLength) { self.cacheableItem.info.contentLength = fileSize; } } else { AFLog(@"Failed to get file attributes for file at path %@. Error: %@", path, [err description]); } [self.cacheableItem flagAsDownloadFinishedWithContentLength:self.cacheableItem.info.contentLength]; if (error) { AFLog(@"Error while finishing download: %@", [err localizedDescription]); } else { // Only cache response if it has a validUntil date and only if we're not in offline mode. if (self.cacheableItem.validUntil) { AFLog(@"Updating file modification date for object with URL: %@", [self.cacheableItem.url absoluteString]); [self.cacheableItem.cache updateModificationDataAndTriggerArchiving:self.cacheableItem]; } } } } [self finish]; BOOL hasAlreadyReturnedCacheItem = (self.cacheableItem.hasReturnedCachedItemBeforeRevalidation && self.cacheableItem.cacheStatus == kCacheStatusNotModified); if (!hasAlreadyReturnedCacheItem) { [self.cacheableItem sendSuccessSignalToClientItems]; } } /* * The connection did fail. Remove item from cache. * TODO: This comment is wrong. Item is not removed from cache here. Should it be removed as the comment says? */ - (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)anError { if (self.isCancelled) { [self finish]; return; } self.cacheableItem.error = anError; BOOL connectionLostOrNoConnection = ([anError code] == kCFURLErrorNotConnectedToInternet || [anError code] == kCFURLErrorNetworkConnectionLost); if (connectionLostOrNoConnection) { self.cacheableItem.cache.connectedToNetwork = NO; } else { NSLog(@"ERROR in download operation: %@", anError); } [self finish]; // There are cases when we send success, despite of the error. Requirements: // - We have no network connection or the connection has been lost // - The response status is below 400 (e.g. no 404) // - The item is complete (the data size on disk matches the content size in the response header) // - OR: Connection lost while revalidating BOOL sendSuccessDespiteError = (connectionLostOrNoConnection && self.cacheableItem.info.statusCode < 400 && self.cacheableItem.isComplete) || (self.cacheableItem.isRevalidating && connectionLostOrNoConnection); if (sendSuccessDespiteError) { [self.cacheableItem sendSuccessSignalToClientItems]; } else { self.cacheableItem.info.actualLength = 0; self.cacheableItem.currentContentLength = 0; [self.cacheableItem sendFailSignalToClientItems]; } } - (void)finishWithError { [self finish]; self.cacheableItem.info.actualLength = 0; self.cacheableItem.currentContentLength = 0; [self.cacheableItem sendFailSignalToClientItems]; } #pragma mark - NSURLConnectionDelegate authentication methods /* * If implemented, will be called before connection:didReceiveAuthenticationChallenge: to give the delegate a chance to * inspect the protection space that will be authenticated against. Delegates should determine if they are prepared to * respond to the authentication method of the protection space and if so, return YES, or NO to allow default processing * to handle the authentication. */ - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace { if ([[protectionSpace authenticationMethod] isEqualToString:NSURLAuthenticationMethodServerTrust]) { // Server is using a SSL certificate that the OS can't validate, see whether the client settings allow validation here if (self.cacheableItem.cache.disableSSLCertificateValidation) { return YES; } } return self.cacheableItem.urlCredential.user && self.cacheableItem.urlCredential.password; } /* * Gets called when basic http authentication is required. Provide given username and password. If login has failed, * aborts the authentication. */ - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { if ([challenge previousFailureCount] > 0) { // Last authentication failed, abort authentication [self connection:connection didCancelAuthenticationChallenge:challenge]; return; } if (self.cacheableItem.urlCredential.user && self.cacheableItem.urlCredential.password) { [[challenge sender] useCredential:self.cacheableItem.urlCredential forAuthenticationChallenge:challenge]; } if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust] && self.cacheableItem.cache.disableSSLCertificateValidation) { [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge]; } else { [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge]; } } - (void)connection:(NSURLConnection *)connection didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { NSError *err = [NSError errorWithDomain: @"HTTP Authentifcation failed" code:99 userInfo:nil]; [self connection:connection didFailWithError:err]; } #pragma mark - Response handling - (void)handleResponse:(NSURLResponse *)response { self.cacheableItem.info.mimeType = [response MIMEType]; NSDate *now = [NSDate date]; self.cacheableItem.info.responseTimestamp = [now timeIntervalSinceReferenceDate]; self.cacheableItem.info.mimeType = [response MIMEType]; // Get HTTP-Status code from response if ([response isKindOfClass:[NSHTTPURLResponse class]]) { self.cacheableItem.info.statusCode = (NSUInteger) [(NSHTTPURLResponse *) response statusCode]; } else { self.cacheableItem.info.statusCode = 200; } // Update modified status if (self.cacheableItem.cacheStatus == kCacheStatusRevalidationPending) { switch (self.cacheableItem.info.statusCode) { case 304: self.cacheableItem.cacheStatus = kCacheStatusNotModified; self.cacheableItem.validUntil = self.cacheableItem.info.expireDate; // The resource has not been modified, so we exit here return; case 200: self.cacheableItem.cacheStatus = kCacheStatusModified; break; } } else { self.cacheableItem.info.responseTimestamp = [now timeIntervalSinceReferenceDate]; self.cacheableItem.info.response = response; } if (self.cacheableItem.info.statusCode == 200) { self.outputStream = [self.cacheableItem.cache createOutputStreamForItem:self.cacheableItem]; } // TODO: Isn't self.cacheableItem.info.contentLength always 0 at this moment? [self.cacheableItem flagAsDownloadStartedWithContentLength:self.cacheableItem.info.contentLength]; if ([response isKindOfClass:[NSHTTPURLResponse class]]) { // Handle response header fields to calculate expiration time for newly fetched object to determine until when we may cache it [self handleResponseHeaderFields:[(NSHTTPURLResponse *) response allHeaderFields] now:now]; } } - (void)handleResponseHeaderFields:(NSDictionary *)headerFields now:(NSDate*) now { #ifdef AFCACHE_LOGGING_ENABLED // log headers NSLog(@"status code: %d", self.cacheableItem.info.statusCode); for (NSString *key in [headerFields allKeys]) { NSString *logString = [NSString stringWithFormat: @"%@: %@", key, [headerFields objectForKey: key]]; NSLog(@"Headers: %@", logString); } #endif // get headers that are used for cache control NSString *ageField = headerFields[@"Age"]; NSString *dateField = headerFields[@"Date"]; NSString *modifiedField = headerFields[@"Last-Modified"]; NSString *expiresField = headerFields[@"Expires"]; NSString *cacheControlField = headerFields[@"Cache-Control"]; NSString *pragmaField = headerFields[@"Pragma"]; NSString *eTagField = headerFields[@"Etag"]; NSString *contentLengthField = headerFields[@"Content-Length"]; self.cacheableItem.info.headers = headerFields; self.cacheableItem.info.contentLength = contentLengthField ? strtoull([contentLengthField UTF8String], NULL, 0) : 0; self.cacheableItem.info.eTag = eTagField; self.cacheableItem.info.maxAge = nil; // Parse 'Age', 'Date', 'Last-Modified', 'Expires' header field by using a date formatter capable of parsing the // date strings with 3 different formats (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3) self.cacheableItem.info.age = [ageField intValue]; self.cacheableItem.info.serverDate = dateField ? [DateParser gh_parseHTTP:dateField] : now; NSDate *lastModifiedDate = modifiedField ? [DateParser gh_parseHTTP:modifiedField] : now; self.cacheableItem.info.lastModified = lastModifiedDate; self.cacheableItem.info.expireDate = [DateParser gh_parseHTTP:expiresField]; // Check if Pragma: no-cache is set (for compatibility with HTTP/1.0 clients) BOOL pragmaNoCacheSet = NO; if (pragmaField) { pragmaNoCacheSet = [pragmaField rangeOfString:@"no-cache"].location != NSNotFound; } // Parse cache-control field (if present) if (cacheControlField) { // check if max-age is set in header fields NSRange range = [cacheControlField rangeOfString:@"max-age="]; if (range.location != NSNotFound) { // Parse max-age (in seconds) unsigned long start = range.location + range.length; unsigned long length = [cacheControlField length] - (range.location + range.length); NSString *maxAgeString = [cacheControlField substringWithRange:NSMakeRange(start, length)]; self.cacheableItem.info.maxAge = @([maxAgeString intValue]); } // Check no-cache in "Cache-Control" (see http://www.ietf.org/rfc/rfc2616.txt - 14.9 Cache-Control, Page 107) pragmaNoCacheSet = ([cacheControlField rangeOfString:@"no-cache"].location != NSNotFound) || [cacheControlField rangeOfString:@"no-store"].location != NSNotFound; // since AFCache can be classified as a private cache, we'll cache objects with the Cache-Control 'private' header too. // see 14.9.1 What is Cacheable // TODO: Consider all Cache-Control parameters /* cache-request-directive = "no-cache" ; Section 14.9.1 | "no-store" ; Section 14.9.2 | "max-age" "=" delta-seconds ; Section 14.9.3, 14.9.4 | "max-stale" [ "=" delta-seconds ] ; Section 14.9.3 | "min-fresh" "=" delta-seconds ; Section 14.9.3 | "no-transform" ; Section 14.9.5 | "only-if-cached" ; Section 14.9.4 | cache-extension ; Section 14.9.6 cache-response-directive = "public" ; Section 14.9.1 | "private" [ "=" <"> 1#field-name <"> ] ; Section 14.9.1 | "no-cache" [ "=" <"> 1#field-name <"> ]; Section 14.9.1 | "no-store" ; Section 14.9.2 | "no-transform" ; Section 14.9.5 | "must-revalidate" ; Section 14.9.4 | "proxy-revalidate" ; Section 14.9.4 | "max-age" "=" delta-seconds ; Section 14.9.3 | "s-maxage" "=" delta-seconds ; Section 14.9.3 | cache-extension ; Section 14.9.6 */ } // Calculate "valid until" field. The 'max-age' directive takes priority over 'Expires', takes priority over 'Last-Modified' BOOL mustNotCache = pragmaNoCacheSet || (self.cacheableItem.info.maxAge && [self.cacheableItem.info.maxAge intValue] == 0); if (mustNotCache) { // Do not cache as either "no-cache" or "no-store" is set or max-age is 0 self.cacheableItem.validUntil = nil; } else if (self.cacheableItem.info.maxAge) { // Create future expire date for max age by adding the given seconds to now. #if ((TARGET_OS_IPHONE == 0 && 1060 <= MAC_OS_X_VERSION_MAX_ALLOWED) || (TARGET_OS_IPHONE == 1 && 40000 <= __IPHONE_OS_VERSION_MAX_ALLOWED)) self.cacheableItem.validUntil = [now dateByAddingTimeInterval: [self.cacheableItem.info.maxAge doubleValue]]; #else self.cacheableItem.validUntil = [now addTimeInterval: [self.cacheableItem.info.maxAge doubleValue]]; #endif } else if (self.cacheableItem.info.expireDate) { self.cacheableItem.validUntil = self.cacheableItem.info.expireDate; } else { self.cacheableItem.validUntil = lastModifiedDate; } } @end ================================================ FILE: src/shared/AFHTTPURLProtocol.h ================================================ // // AFHTTPURLProtocol.h // AFCache-iOS // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 Artifacts - Fine Software Development. All rights reserved. // #import #import "AFCache.h" @interface AFHTTPURLProtocol : NSURLProtocol { NSURLRequest *m_request; } @property (nonatomic, strong) NSURLRequest *request; @end ================================================ FILE: src/shared/AFHTTPURLProtocol.m ================================================ // // AFHTTPURLProtocol.m // AFCache-iOS // // Created by Michael Markowski on 11.03.12. // Copyright (c) 2012 Artifacts - Fine Software Development. All rights reserved. // /* * * Copyright 2012 artifacts Software GmbH & Co. KG * http://www.artifacts.de * Author: Michael Markowski (m.markowski@artifacts.de) * Many thanks to Rob Napier's excellent post about using NSURLProtocol * instead of NSURLCache for WebView offline caching: * http://robnapier.net/blog/offline-uiwebview-nsurlprotocol-588/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import "AFHTTPURLProtocol.h" @implementation AFHTTPURLProtocol @synthesize request = m_request; + (BOOL)canInitWithRequest:(NSURLRequest *)request { return [[[request URL] scheme] isEqualToString:@"http"] && [request valueForHTTPHeaderField:AFCachingURLHeader] == nil && [request valueForHTTPHeaderField:AFCacheInternalRequestHeader] == nil; } + (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request { return request; } - (id)initWithRequest:(NSURLRequest *)aRequest cachedResponse:(NSCachedURLResponse *)cachedResponse client:(id )client { // Modify request so we don't loop NSMutableURLRequest *myRequest = [aRequest mutableCopy]; [myRequest setValue:@"" forHTTPHeaderField:AFCachingURLHeader]; self = [super initWithRequest:myRequest cachedResponse:cachedResponse client:client]; if (self) { [self setRequest:myRequest]; } return self; } - (void)startLoading { [[AFCache sharedInstance] cachedObjectForRequest:self.request delegate:self]; } - (void) connectionDidFail: (AFCacheableItem *) cacheableItem { [[self client] URLProtocol:self didFailWithError:[NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCannotConnectToHost userInfo:nil]]; } - (void) connectionDidFinish: (AFCacheableItem *) cacheableItem { NSAssert(cacheableItem.info.response != nil, @"Response must not be nil - this is a software bug"); if (cacheableItem.info.redirectRequest && cacheableItem.info.redirectResponse) { // for some reason this does not work when in flight mode... NSURLRequest *redirectRequest = cacheableItem.servedFromCache && !cacheableItem.URLInternallyRewritten ? self.request : cacheableItem.info.redirectRequest; NSURLResponse *redirectResponse = cacheableItem.info.redirectResponse; [[self client] URLProtocol:self wasRedirectedToRequest:redirectRequest redirectResponse:redirectResponse]; } else { [[self client] URLProtocol:self didReceiveResponse:cacheableItem.info.response cacheStoragePolicy:NSURLCacheStorageAllowed]; [[self client] URLProtocol:self didLoadData:cacheableItem.data]; [[self client] URLProtocolDidFinishLoading:self]; } } - (void)connectionHasBeenRedirected: (AFCacheableItem*) cacheableItem { // don't inform client right now, but when finished downloading. Otherwise the response will not come back to AFCache... } - (void)stopLoading { [[AFCache sharedInstance] cancelAsynchronousOperationsForURL:[[self request] URL] itemDelegate:self]; } - (NSCachedURLResponse *)cachedResponse { return [super cachedResponse]; } @end ================================================ FILE: src/shared/AFMediaTypeParser.h ================================================ // // AFMIMEParser.h // AFCache-iOS // // Created by Martin Jansen on 25.02.12. // Copyright (c) 2012 Artifacts - Fine Software Development. All rights reserved. // #import /** * Implements a RFC 2616 confirming parser for extracting the * content type and the character encoding from Internet Media * Types */ @interface AFMediaTypeParser : NSObject { NSString* mimeType; NSString* __unsafe_unretained _textEncoding; NSString* __unsafe_unretained _contentType; } @property (unsafe_unretained, nonatomic, readonly) NSString* textEncoding; @property (unsafe_unretained, nonatomic, readonly) NSString* contentType; - (id) initWithMIMEType:(NSString*)theMIMEType; @end ================================================ FILE: src/shared/AFMediaTypeParser.m ================================================ // // AFMIMEParser.m // AFCache-iOS // // Created by Martin Jansen on 25.02.12. // Copyright (c) 2012 Artifacts - Fine Software Development. All rights reserved. // #import "AFMediaTypeParser.h" #define kCharsetName @"charset" #define kTokenDelimiter @";" #define kParameterDelimiter @"=" @interface AFMediaTypeParser (private) - (void) parse; - (NSString*) trim:(NSString*)aString; @end @implementation AFMediaTypeParser @synthesize textEncoding = _textEncoding; @synthesize contentType = _contentType; #pragma mark Object lifecycle - (id) initWithMIMEType:(NSString*)aMIMEType { self = [super init]; if (self) { mimeType = aMIMEType; _textEncoding = nil; _contentType = nil; [self parse]; } return self; } #pragma mark - - (void) parse { NSArray *components = [mimeType componentsSeparatedByString:kTokenDelimiter]; if (1 >= [components count]) { _contentType = [self trim:mimeType]; return; } _contentType = [self trim:(NSString*)[components objectAtIndex:0]]; for (NSUInteger i = 1; i < [components count]; i++) { NSString *parameter = [components objectAtIndex:i]; NSArray *parameterComponents = [parameter componentsSeparatedByString:kParameterDelimiter]; if (2 != [parameterComponents count]) { continue; } NSString *name = [self trim:[parameterComponents objectAtIndex:0]]; NSString *value = [self trim:[parameterComponents objectAtIndex:1]]; if ([name isEqualToString:kCharsetName]) { _textEncoding = value; break; } } } - (NSString*) trim:(NSString*)aString { // http://stackoverflow.com/a/8293671/132475 NSMutableString *mStr = [aString mutableCopy]; CFStringTrimWhitespace((CFMutableStringRef)mStr); NSString *result = [mStr copy]; return result; } @end ================================================ FILE: src/shared/AFPackageInfo.h ================================================ // // AFPackageItemInfo.h // AFCache // // Created by Michael Markowski on 28.01.11. // Copyright 2011 Artifacts - Fine Software Development. All rights reserved. // #import @interface AFPackageInfo : NSObject { NSURL *packageURL; NSURL *baseURL; NSArray *resourceURLs; NSMutableDictionary *userData; } @property (nonatomic, strong) NSURL *packageURL; @property (nonatomic, strong) NSURL *baseURL; @property (nonatomic, strong) NSArray *resourceURLs; @property (nonatomic, strong) NSMutableDictionary *userData; @end ================================================ FILE: src/shared/AFPackageInfo.m ================================================ // // AFPackageItemInfo.m // AFCache // // Created by Michael Markowski on 28.01.11. // Copyright 2011 Artifacts - Fine Software Development. All rights reserved. // #import "AFPackageInfo.h" @implementation AFPackageInfo @synthesize packageURL, baseURL, resourceURLs, userData; - (id)init { self = [super init]; if (self != nil) { resourceURLs = [[NSArray alloc] init]; userData = [[NSMutableDictionary alloc] init]; } return self; } - (void)encodeWithCoder: (NSCoder *) coder { [coder encodeObject: packageURL forKey: @"AFPkgInfo_packageURL"]; [coder encodeObject: baseURL forKey: @"AFPkgInfo_baseURL"]; [coder encodeObject: resourceURLs forKey: @"AFPkgInfo_resourceURLs"]; [coder encodeObject: userData forKey: @"AFPkgInfo_userData"]; } - (id)initWithCoder: (NSCoder *) coder { self.packageURL = [coder decodeObjectForKey: @"AFPkgInfo_packageURL"]; self.baseURL = [coder decodeObjectForKey: @"AFPkgInfo_baseURL"]; self.resourceURLs = [coder decodeObjectForKey: @"AFPkgInfo_resourceURLs"]; self.userData = [coder decodeObjectForKey: @"AFPkgInfo_userData"]; return self; } - (NSString*)description { NSMutableString *s = [NSMutableString stringWithString:@"Cache information:\n"]; [s appendFormat:@"packageURL: %@\n", packageURL]; [s appendFormat:@"baseURL: %@\n", baseURL]; [s appendFormat:@"resourceURLs: %@\n", [resourceURLs description]]; [s appendFormat:@"userData: %@\n", [userData description]]; return s; } @end ================================================ FILE: src/shared/AFRequestConfiguration.h ================================================ // // AFRequestConfiguration.h // AFCache // // Created by Sebastian Grimme on 24.07.14. // Copyright (c) 2014 Artifacts - Fine Software Development. All rights reserved. // #import @interface AFRequestConfiguration : NSObject @property (nonatomic, assign) int options; @property (nonatomic, strong) id userData; @property (nonatomic, strong) NSURLRequest *request; @end ================================================ FILE: src/shared/AFRequestConfiguration.m ================================================ // // AFRequestConfiguration.m // AFCache // // Created by Sebastian Grimme on 24.07.14. // Copyright (c) 2014 Artifacts - Fine Software Development. All rights reserved. // #import "AFRequestConfiguration.h" @implementation AFRequestConfiguration @end ================================================ FILE: src/shared/AFURLCache.h ================================================ /* * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Contributed by Nico Schmidt - savoysoftware.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #import @interface AFURLCache : NSURLCache { } @end ================================================ FILE: src/shared/AFURLCache.m ================================================ /* * * Copyright 2008 Artifacts - Fine Software Development * http://www.artifacts.de * Contributed by Nico Schmidt - savoysoftware.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #import "AFURLCache.h" #import "AFCache+PrivateAPI.h" #import "AFCache+Packaging.h" #import "DateParser.h" #import "AFMediaTypeParser.h" @implementation AFURLCache -(NSCachedURLResponse*)cachedResponseForRequest:(NSURLRequest*)request { NSURL* url = request.URL; AFCacheableItem* item = [[AFCache sharedInstance] cacheableItemFromCacheStore:url]; if (item && item.cacheStatus == kCacheStatusFresh) { AFMediaTypeParser *parser = [[AFMediaTypeParser alloc] initWithMIMEType:item.info.mimeType]; NSURLResponse* response = [[NSURLResponse alloc] initWithURL:item.url MIMEType:parser.contentType expectedContentLength:[item.data length] textEncodingName:parser.contentType]; NSCachedURLResponse *cachedResponse = [[NSCachedURLResponse alloc] initWithResponse:response data:item.data userInfo:nil storagePolicy:NSURLCacheStorageAllowedInMemoryOnly]; return cachedResponse; } else { //NSLog(@"Cache miss for file: %@", [[AFCache sharedInstance] filenameForURL: url]); } NSCachedURLResponse *response = [super cachedResponseForRequest:request]; return response; } - (void)storeCachedResponse:(NSCachedURLResponse *)cachedResponse forRequest:(NSURLRequest *)request { //NSLog(@"request %@ resulted in response: %@", [request description], [cachedResponse description]); NSDate *lastModified = nil; NSDate *expireDate = nil; if ([cachedResponse.response isKindOfClass: [NSHTTPURLResponse self]]) { NSDictionary *headers = [(NSHTTPURLResponse *) cachedResponse.response allHeaderFields]; NSString *modifiedHeader = [headers objectForKey: @"Last-Modified"]; NSString *expiresHeader = [headers objectForKey: @"Expires"]; NSString *contentTypeHeader = [headers objectForKey: @"Content-Type"]; lastModified = (modifiedHeader) ? [DateParser gh_parseHTTP: modifiedHeader] : [NSDate date]; expireDate = (expiresHeader) ? [DateParser gh_parseHTTP: expiresHeader] : nil; AFCacheableItem *item = [[AFCacheableItem alloc] initWithURL:request.URL lastModified:lastModified expireDate:expireDate contentType:contentTypeHeader]; [[AFCache sharedInstance] importCacheableItem:item withData:cachedResponse.data]; } } @end ================================================ FILE: src/shared/DateParser.h ================================================ // // AFNSDate+Parsing.h copied from GHNSDate+Parsing.h by Gabriel Handford // Original copyright notice below. // // // Created by Gabe on 3/18/08. // Copyright 2008 Gabriel Handford // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // #import @interface DateParser : NSDate { NSDateFormatter* gh_rfc1123DateFormatter; NSDateFormatter* gh_rfc850DateFormatter; NSDateFormatter* gh_ascTimeDateFormatter; NSDateFormatter* gh_is8601DateFormatter; NSDateFormatter* gh_rfc822DateFormatter; } - (NSDate *)gh_parseISO8601: (NSString *) dateString; + (NSDate *)gh_parseISO8601: (NSString *) dateString; /*! @method gh_parseRFC822 @abstract Parse RFC822 encoded date @param dateString Date string to parse, eg. 'Wed, 01 Mar 2006 12:00:00 -0400' @result Date */ - (NSDate *)gh_parseRFC822: (NSString *) dateString; + (NSDate *)gh_parseRFC822: (NSString *) dateString; /*! @method gh_parseHTTP @abstract Parse http date, currently only handles RFC1123 date @param dateString Date string to parse HTTP-date = rfc1123-date | rfc850-date | asctime-date Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format */ - (NSDate *)gh_parseHTTP: (NSString *) dateString; + (NSDate *)gh_parseHTTP: (NSString *) dateString; /*! Parse time since epoch. @param timeSinceEpoch An NSNumber or NSString (responds to longLongValue) @result NSDate or nil if timeSinceEpoch was nil */ - (NSDate *)gh_parseTimeSinceEpoch: (id) timeSinceEpoch; + (NSDate *)gh_parseTimeSinceEpoch: (id) timeSinceEpoch; - (NSDate *)gh_parseTimeSinceEpoch: (id) timeSinceEpoch withDefault: (id) value; + (NSDate *)gh_parseTimeSinceEpoch: (id) timeSinceEpoch withDefault: (id) value; /*! @method gh_formatRFC822 @abstract Get date formatted for RFC822 @result The date string, like "Wed, 01 Mar 2006 12:00:00 -0400" */ - (NSString *)gh_formatRFC822; /*! @method gh_formatHTTP @abstract Get date formatted for RFC1123 (HTTP date) @result The date string, like "Sun, 06 Nov 1994 08:49:37 GMT" */ - (NSString *)gh_formatHTTP; /*! @method gh_formatISO8601 @abstract Get date formatted for ISO8601 (XML date) @result The date string, like ... TODO(gabe) */ - (NSString *)gh_formatISO8601; /*! @method gh_iso8601DateFormatter @abstract For example, '2007-10-18T16:05:10.000Z'. Returns a new autoreleased formatter since NSDateFormatter is not thread-safe. @result Date formatter for ISO8601 */ - (NSDateFormatter *)gh_iso8601DateFormatter; + (NSDateFormatter *)gh_iso8601DateFormatter; /*! @method gh_rfc822DateFormatter @abstract For example, 'Wed, 01 Mar 2006 12:00:00 -0400'. Returns a new autoreleased formatter since NSDateFormatter is not thread-safe. @result Date formatter for RFC822 */ - (NSDateFormatter *)gh_rfc822DateFormatter; + (NSDateFormatter *)gh_rfc822DateFormatter; /*! @method gh_rfc1123DateFormatter @abstract For example, 'Wed, 01 Mar 2006 12:00:00 GMT'. Returns a new autoreleased formatter since NSDateFormatter is not thread-safe. @result Date formatter for RFC1123 */ - (NSDateFormatter *)gh_rfc1123DateFormatter; + (NSDateFormatter *)gh_rfc1123DateFormatter; /*! @method gh_rfc850DateFormatter @abstract For example, 'Sunday, 06-Nov-94 08:49:37 GMT'. Returns a new autoreleased formatter since NSDateFormatter is not thread-safe. @result Date formatter for RFC850 */ - (NSDateFormatter *)gh_rfc850DateFormatter; + (NSDateFormatter *)gh_rfc850DateFormatter; /*! @method gh_ascTimeDateFormatter @abstract For example, 'Sun Nov 6 08:49:37 1994'. Returns a new autoreleased formatter since NSDateFormatter is not thread-safe. @result Date formatter for asctime */ - (NSDateFormatter *)gh_ascTimeDateFormatter; + (NSDateFormatter *)gh_ascTimeDateFormatter; - (NSString *)formatHTTPDate:(NSDate*)date; + (NSString *)formatHTTPDate:(NSDate*)date; @end ================================================ FILE: src/shared/DateParser.m ================================================ // // AFNSDate+Parsing.h copied from GHNSDate+Parsing.h by Gabriel Handford // Original copyright notice below. // // // Created by Gabe on 3/18/08. // Copyright 2008 Gabriel Handford // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // #import "DateParser.h" @implementation DateParser - (NSDate *)gh_parseISO8601: (NSString *) dateString { if (!dateString) return nil; return [[self gh_iso8601DateFormatter] dateFromString: dateString]; } + (NSDate *)gh_parseISO8601: (NSString *) dateString { if (!dateString) return nil; return [[self gh_iso8601DateFormatter] dateFromString: dateString]; } - (NSDate *)gh_parseRFC822: (NSString *) dateString { if (!dateString) return nil; return [[self gh_rfc822DateFormatter] dateFromString: dateString]; } + (NSDate *)gh_parseRFC822: (NSString *) dateString { if (!dateString) return nil; return [[self gh_rfc822DateFormatter] dateFromString: dateString]; } - (NSDate *)gh_parseHTTP: (NSString *) dateString { if (!dateString) return nil; NSDate *parsed = nil; parsed = [[self gh_rfc1123DateFormatter] dateFromString: dateString]; if (parsed) return parsed; parsed = [[self gh_rfc850DateFormatter] dateFromString: dateString]; if (parsed) return parsed; parsed = [[self gh_ascTimeDateFormatter] dateFromString: dateString]; return parsed; } + (NSDate *)gh_parseHTTP: (NSString *) dateString { if (!dateString) return nil; NSDate *parsed = nil; parsed = [[self gh_rfc1123DateFormatter] dateFromString: dateString]; if (parsed) return parsed; parsed = [[self gh_rfc850DateFormatter] dateFromString: dateString]; if (parsed) return parsed; parsed = [[self gh_ascTimeDateFormatter] dateFromString: dateString]; return parsed; } - (NSDate *)gh_parseTimeSinceEpoch: (id) timeSinceEpoch { return [self gh_parseTimeSinceEpoch: timeSinceEpoch withDefault: timeSinceEpoch]; } + (NSDate *)gh_parseTimeSinceEpoch: (id) timeSinceEpoch { return [self gh_parseTimeSinceEpoch: timeSinceEpoch withDefault: timeSinceEpoch]; } - (NSDate *)gh_parseTimeSinceEpoch: (id) timeSinceEpoch withDefault: (id) value { if (!timeSinceEpoch) return value; return [NSDate dateWithTimeIntervalSince1970: [timeSinceEpoch longLongValue]]; } + (NSDate *)gh_parseTimeSinceEpoch: (id) timeSinceEpoch withDefault: (id) value { if (!timeSinceEpoch) return value; return [NSDate dateWithTimeIntervalSince1970: [timeSinceEpoch longLongValue]]; } - (NSString *)gh_formatRFC822 { return [[self gh_rfc822DateFormatter] stringFromDate: self]; } - (NSString *)gh_formatHTTP { return [[self gh_rfc1123DateFormatter] stringFromDate: self]; } - (NSString *)formatHTTPDate: (NSDate *) date { return [[self gh_rfc1123DateFormatter] stringFromDate: date]; } + (NSString *)formatHTTPDate: (NSDate *) date { return [[self gh_rfc1123DateFormatter] stringFromDate: date]; } - (NSString *)gh_formatISO8601 { return [[self gh_iso8601DateFormatter] stringFromDate: self]; } + (NSDateFormatter *)gh_rfc822DateFormatter { NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setFormatterBehavior: NSDateFormatterBehavior10_4]; // Need to force US locale when generating otherwise it might not be 822 compatible [dateFormatter setLocale: [[NSLocale alloc] initWithLocaleIdentifier: @"en_US"]]; [dateFormatter setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]]; [dateFormatter setDateFormat: @"EEE, dd MMM yyyy HH:mm:ss ZZZ"]; return dateFormatter; } - (NSDateFormatter *)gh_rfc822DateFormatter { if (nil == gh_rfc822DateFormatter) { gh_rfc822DateFormatter = [[self class] gh_rfc822DateFormatter]; } return gh_rfc822DateFormatter; } + (NSDateFormatter *)gh_iso8601DateFormatter { NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setFormatterBehavior: NSDateFormatterBehavior10_4]; // Need to force US locale when generating otherwise it might not be 8601 compatible [dateFormatter setLocale: [[NSLocale alloc] initWithLocaleIdentifier: @"en_US"]]; [dateFormatter setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]]; [dateFormatter setDateFormat: @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"]; return dateFormatter; } - (NSDateFormatter *)gh_iso8601DateFormatter { // Example: 2007-10-18T16:05:10.000Z if (nil == gh_is8601DateFormatter) { gh_is8601DateFormatter = [[self class] gh_iso8601DateFormatter]; } return gh_is8601DateFormatter; } + (NSDateFormatter *)gh_rfc1123DateFormatter { NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setFormatterBehavior: NSDateFormatterBehavior10_4]; // Need to force US locale when generating otherwise it might not be 822 compatible [dateFormatter setLocale: [[NSLocale alloc] initWithLocaleIdentifier: @"en_US"]]; [dateFormatter setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]]; [dateFormatter setDateFormat: @"EEE, dd MMM yyyy HH:mm:ss zzz"]; return dateFormatter; } - (NSDateFormatter *)gh_rfc1123DateFormatter { // Example: "Wed, 01 Mar 2006 12:00:00 GMT" if (nil == gh_rfc1123DateFormatter) { gh_rfc1123DateFormatter = [[self class] gh_rfc1123DateFormatter]; } return gh_rfc1123DateFormatter; } + (NSDateFormatter *)gh_rfc850DateFormatter { NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setFormatterBehavior: NSDateFormatterBehavior10_4]; [dateFormatter setLocale: [[NSLocale alloc] initWithLocaleIdentifier: @"en_US"]]; [dateFormatter setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]]; [dateFormatter setDateFormat: @"EEEE, dd-MMM-yy HH:mm:ss zzz"]; return dateFormatter; } - (NSDateFormatter *)gh_rfc850DateFormatter { // Example: Sunday, 06-Nov-94 08:49:37 GMT if (nil == gh_rfc850DateFormatter) { gh_rfc850DateFormatter = [[self class] gh_rfc850DateFormatter]; } return gh_rfc850DateFormatter; } + (NSDateFormatter *)gh_ascTimeDateFormatter { NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setFormatterBehavior: NSDateFormatterBehavior10_4]; [dateFormatter setLocale: [[NSLocale alloc] initWithLocaleIdentifier: @"en_US"]]; [dateFormatter setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT: 0]]; [dateFormatter setDateFormat: @"EEE MMM d HH:mm:ss yyyy"]; return dateFormatter; } - (NSDateFormatter *)gh_ascTimeDateFormatter { // Example: Sun Nov 6 08:49:37 1994 if (nil == gh_ascTimeDateFormatter) { gh_ascTimeDateFormatter = [[self class] gh_ascTimeDateFormatter]; } return gh_ascTimeDateFormatter; } @end ================================================ FILE: testserver.py ================================================ #! /usr/bin/env python import time import BaseHTTPServer import urlparse HOST_NAME = 'localhost' PORT_NUMBER = 49000 def makeBestType(s): try: return int(s) except: pass try: return float(s) except: pass return s def sendFile(s, numBytes=100, delay=0.0, blockSize=100): s.send_response(200) s.send_header("Content-type", "text/html") s.send_header("Content-Length", "%d" % numBytes) s.end_headers() sentBytes = 0 while sentBytes < numBytes: time.sleep(delay) actualBytes = (sentBytes + blockSize) if actualBytes > numBytes: actualBytes = numBytes s.wfile.write("a" * (actualBytes - sentBytes)) s.wfile.flush() sentBytes = actualBytes print sentBytes responses = { "/file" : sendFile } class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_HEAD(self): self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() def do_GET(self): """Respond to a GET request.""" if self.headers.has_key('If-Modified-Since'): self.send_response(304) return components = urlparse.urlsplit(self.path) path = components[2] params = components[3].split('&') print params parameters = {} for p in params: k, v = p.split('=') v = makeBestType(v) parameters[k] = v if responses.has_key(path): responses[path](self, **parameters) if __name__ == '__main__': server_class = BaseHTTPServer.HTTPServer httpd = server_class((HOST_NAME, PORT_NUMBER), MyHandler) try: httpd.serve_forever() except KeyboardInterrupt: pass httpd.server_close()