Martijn The avatar Martijn The committed 3824681

Real initial commit :-)

Comments (0)

Files changed (17)

+build

NSURLConnectionVCR.xcodeproj/project.pbxproj

 	objects = {
 
 /* Begin PBXBuildFile section */
+		1007805E14FBE3A8009362E5 /* NSURLConnectionVCR.mm in Sources */ = {isa = PBXBuildFile; fileRef = 10852AEB14F906A70004895D /* NSURLConnectionVCR.mm */; };
+		1007806014FBE3B9009362E5 /* SKUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 10852AE914F906A70004895D /* SKUtils.mm */; };
+		1007806314FBE8B5009362E5 /* VCRGetPreview.h in Headers */ = {isa = PBXBuildFile; fileRef = 1007806114FBE8B5009362E5 /* VCRGetPreview.h */; };
+		1007806414FBE8B5009362E5 /* VCRGetPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = 1007806214FBE8B5009362E5 /* VCRGetPreview.m */; };
+		1007806614FBEC26009362E5 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1007806514FBEC26009362E5 /* WebKit.framework */; };
+		1007806814FBEC5C009362E5 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1007806714FBEC5C009362E5 /* AppKit.framework */; };
+		1031062A14FA83E600C9133A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1031062914FA83E600C9133A /* Security.framework */; };
+		1083AE9014FA816F00ABF053 /* DDData.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD8614FA816E00ABF053 /* DDData.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9114FA816F00ABF053 /* DDNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD8814FA816E00ABF053 /* DDNumber.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9214FA816F00ABF053 /* DDRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD8A14FA816E00ABF053 /* DDRange.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9314FA816F00ABF053 /* HTTPAuthenticationRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD8C14FA816E00ABF053 /* HTTPAuthenticationRequest.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9414FA816F00ABF053 /* HTTPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD8E14FA816E00ABF053 /* HTTPConnection.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9514FA816F00ABF053 /* HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD9114FA816E00ABF053 /* HTTPMessage.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9614FA816F00ABF053 /* HTTPServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD9414FA816E00ABF053 /* HTTPServer.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9714FA816F00ABF053 /* HTTPAsyncFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD9714FA816E00ABF053 /* HTTPAsyncFileResponse.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9814FA816F00ABF053 /* HTTPDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD9914FA816E00ABF053 /* HTTPDataResponse.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9914FA816F00ABF053 /* HTTPDynamicFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD9B14FA816E00ABF053 /* HTTPDynamicFileResponse.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9A14FA816F00ABF053 /* HTTPFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD9D14FA816E00ABF053 /* HTTPFileResponse.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9B14FA816F00ABF053 /* HTTPRedirectResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AD9F14FA816E00ABF053 /* HTTPRedirectResponse.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AE9C14FA816F00ABF053 /* WebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083ADA114FA816E00ABF053 /* WebSocket.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AEF414FA816F00ABF053 /* GCDAsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AE5D14FA816E00ABF053 /* GCDAsyncSocket.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AEF614FA816F00ABF053 /* DDASLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AE6114FA816E00ABF053 /* DDASLLogger.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AEF714FA816F00ABF053 /* DDAbstractDatabaseLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AE6314FA816E00ABF053 /* DDAbstractDatabaseLogger.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AEF814FA816F00ABF053 /* DDFileLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AE6514FA816E00ABF053 /* DDFileLogger.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AEF914FA816F00ABF053 /* DDLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AE6714FA816E00ABF053 /* DDLog.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+		1083AEFA14FA816F00ABF053 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 1083AE6914FA816E00ABF053 /* DDTTYLogger.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
 		10852ABC14F906870004895D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10852ABB14F906870004895D /* Cocoa.framework */; };
 		10852AC614F906870004895D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 10852AC414F906870004895D /* InfoPlist.strings */; };
-		10852ACA14F906870004895D /* NSURLConnectionVCR.m in Sources */ = {isa = PBXBuildFile; fileRef = 10852AC914F906870004895D /* NSURLConnectionVCR.m */; };
 		10852AD214F906870004895D /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10852AD114F906870004895D /* SenTestingKit.framework */; };
 		10852AD314F906870004895D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10852ABB14F906870004895D /* Cocoa.framework */; };
 		10852AD614F906870004895D /* NSURLConnectionVCR.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10852AB814F906870004895D /* NSURLConnectionVCR.framework */; };
 		10852ADC14F906870004895D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 10852ADA14F906870004895D /* InfoPlist.strings */; };
 		10852ADF14F906870004895D /* NSURLConnectionVCRTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 10852ADE14F906870004895D /* NSURLConnectionVCRTests.m */; };
+		10852AEC14F906A70004895D /* SKUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 10852AE814F906A70004895D /* SKUtils.h */; };
+		10852AED14F906A70004895D /* SKUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 10852AE914F906A70004895D /* SKUtils.mm */; };
+		10852AEE14F906A70004895D /* NSURLConnectionVCR.h in Headers */ = {isa = PBXBuildFile; fileRef = 10852AEA14F906A70004895D /* NSURLConnectionVCR.h */; };
+		10852AEF14F906A70004895D /* NSURLConnectionVCR.mm in Sources */ = {isa = PBXBuildFile; fileRef = 10852AEB14F906A70004895D /* NSURLConnectionVCR.mm */; };
+		10ACCB8114FBD73D007F9BB5 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10ACCB8014FBD73D007F9BB5 /* CoreServices.framework */; };
+		10ACCB8B14FBDA06007F9BB5 /* QuickLook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10ACCB8A14FBDA06007F9BB5 /* QuickLook.framework */; };
+		10ACCB8D14FBDA06007F9BB5 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10ACCB8C14FBDA06007F9BB5 /* ApplicationServices.framework */; };
+		10ACCB8E14FBDA06007F9BB5 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10ACCB8014FBD73D007F9BB5 /* CoreServices.framework */; };
+		10ACCB9014FBDA06007F9BB5 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10ACCB8F14FBDA06007F9BB5 /* CoreFoundation.framework */; };
+		10ACCB9614FBDA06007F9BB5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 10ACCB9414FBDA06007F9BB5 /* InfoPlist.strings */; };
+		10ACCB9814FBDA06007F9BB5 /* GenerateThumbnailForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 10ACCB9714FBDA06007F9BB5 /* GenerateThumbnailForURL.m */; };
+		10ACCB9A14FBDA06007F9BB5 /* GeneratePreviewForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 10ACCB9914FBDA06007F9BB5 /* GeneratePreviewForURL.m */; };
+		10ACCB9C14FBDA06007F9BB5 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 10ACCB9B14FBDA06007F9BB5 /* main.c */; };
+		10ACCBA214FBDB11007F9BB5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10ACCBA114FBDB11007F9BB5 /* Foundation.framework */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
+		1007806114FBE8B5009362E5 /* VCRGetPreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VCRGetPreview.h; sourceTree = "<group>"; };
+		1007806214FBE8B5009362E5 /* VCRGetPreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VCRGetPreview.m; sourceTree = "<group>"; };
+		1007806514FBEC26009362E5 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/WebKit.framework; sourceTree = DEVELOPER_DIR; };
+		1007806714FBEC5C009362E5 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AppKit.framework; sourceTree = DEVELOPER_DIR; };
+		1031062914FA83E600C9133A /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
+		1083AD8514FA816E00ABF053 /* DDData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDData.h; sourceTree = "<group>"; };
+		1083AD8614FA816E00ABF053 /* DDData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDData.m; sourceTree = "<group>"; };
+		1083AD8714FA816E00ABF053 /* DDNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDNumber.h; sourceTree = "<group>"; };
+		1083AD8814FA816E00ABF053 /* DDNumber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDNumber.m; sourceTree = "<group>"; };
+		1083AD8914FA816E00ABF053 /* DDRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDRange.h; sourceTree = "<group>"; };
+		1083AD8A14FA816E00ABF053 /* DDRange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDRange.m; sourceTree = "<group>"; };
+		1083AD8B14FA816E00ABF053 /* HTTPAuthenticationRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPAuthenticationRequest.h; sourceTree = "<group>"; };
+		1083AD8C14FA816E00ABF053 /* HTTPAuthenticationRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPAuthenticationRequest.m; sourceTree = "<group>"; };
+		1083AD8D14FA816E00ABF053 /* HTTPConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPConnection.h; sourceTree = "<group>"; };
+		1083AD8E14FA816E00ABF053 /* HTTPConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPConnection.m; sourceTree = "<group>"; };
+		1083AD8F14FA816E00ABF053 /* HTTPLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPLogging.h; sourceTree = "<group>"; };
+		1083AD9014FA816E00ABF053 /* HTTPMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPMessage.h; sourceTree = "<group>"; };
+		1083AD9114FA816E00ABF053 /* HTTPMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPMessage.m; sourceTree = "<group>"; };
+		1083AD9214FA816E00ABF053 /* HTTPResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPResponse.h; sourceTree = "<group>"; };
+		1083AD9314FA816E00ABF053 /* HTTPServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPServer.h; sourceTree = "<group>"; };
+		1083AD9414FA816E00ABF053 /* HTTPServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPServer.m; sourceTree = "<group>"; };
+		1083AD9614FA816E00ABF053 /* HTTPAsyncFileResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPAsyncFileResponse.h; sourceTree = "<group>"; };
+		1083AD9714FA816E00ABF053 /* HTTPAsyncFileResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPAsyncFileResponse.m; sourceTree = "<group>"; };
+		1083AD9814FA816E00ABF053 /* HTTPDataResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDataResponse.h; sourceTree = "<group>"; };
+		1083AD9914FA816E00ABF053 /* HTTPDataResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDataResponse.m; sourceTree = "<group>"; };
+		1083AD9A14FA816E00ABF053 /* HTTPDynamicFileResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPDynamicFileResponse.h; sourceTree = "<group>"; };
+		1083AD9B14FA816E00ABF053 /* HTTPDynamicFileResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPDynamicFileResponse.m; sourceTree = "<group>"; };
+		1083AD9C14FA816E00ABF053 /* HTTPFileResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPFileResponse.h; sourceTree = "<group>"; };
+		1083AD9D14FA816E00ABF053 /* HTTPFileResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPFileResponse.m; sourceTree = "<group>"; };
+		1083AD9E14FA816E00ABF053 /* HTTPRedirectResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPRedirectResponse.h; sourceTree = "<group>"; };
+		1083AD9F14FA816E00ABF053 /* HTTPRedirectResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPRedirectResponse.m; sourceTree = "<group>"; };
+		1083ADA014FA816E00ABF053 /* WebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocket.h; sourceTree = "<group>"; };
+		1083ADA114FA816E00ABF053 /* WebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebSocket.m; sourceTree = "<group>"; };
+		1083AE5B14FA816E00ABF053 /* About.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = About.txt; sourceTree = "<group>"; };
+		1083AE5C14FA816E00ABF053 /* GCDAsyncSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCDAsyncSocket.h; sourceTree = "<group>"; };
+		1083AE5D14FA816E00ABF053 /* GCDAsyncSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GCDAsyncSocket.m; sourceTree = "<group>"; };
+		1083AE5F14FA816E00ABF053 /* About.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = About.txt; sourceTree = "<group>"; };
+		1083AE6014FA816E00ABF053 /* DDASLLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDASLLogger.h; sourceTree = "<group>"; };
+		1083AE6114FA816E00ABF053 /* DDASLLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDASLLogger.m; sourceTree = "<group>"; };
+		1083AE6214FA816E00ABF053 /* DDAbstractDatabaseLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDAbstractDatabaseLogger.h; sourceTree = "<group>"; };
+		1083AE6314FA816E00ABF053 /* DDAbstractDatabaseLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDAbstractDatabaseLogger.m; sourceTree = "<group>"; };
+		1083AE6414FA816E00ABF053 /* DDFileLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDFileLogger.h; sourceTree = "<group>"; };
+		1083AE6514FA816E00ABF053 /* DDFileLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDFileLogger.m; sourceTree = "<group>"; };
+		1083AE6614FA816E00ABF053 /* DDLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDLog.h; sourceTree = "<group>"; };
+		1083AE6714FA816E00ABF053 /* DDLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDLog.m; sourceTree = "<group>"; };
+		1083AE6814FA816E00ABF053 /* DDTTYLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDTTYLogger.h; sourceTree = "<group>"; };
+		1083AE6914FA816E00ABF053 /* DDTTYLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDTTYLogger.m; sourceTree = "<group>"; };
 		10852AB814F906870004895D /* NSURLConnectionVCR.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NSURLConnectionVCR.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		10852ABB14F906870004895D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
 		10852ABE14F906870004895D /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
 		10852ABF14F906870004895D /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
 		10852AC014F906870004895D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
-		10852AC314F906870004895D /* NSURLConnectionVCR-Info.plist */ = {isa = PBXFileReference; path = "NSURLConnectionVCR-Info.plist"; sourceTree = "<group>"; };
+		10852AC314F906870004895D /* NSURLConnectionVCR-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NSURLConnectionVCR-Info.plist"; sourceTree = "<group>"; };
 		10852AC514F906870004895D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
-		10852AC714F906870004895D /* NSURLConnectionVCR-Prefix.pch */ = {isa = PBXFileReference; path = "NSURLConnectionVCR-Prefix.pch"; sourceTree = "<group>"; };
-		10852AC814F906870004895D /* NSURLConnectionVCR.h */ = {isa = PBXFileReference; path = NSURLConnectionVCR.h; sourceTree = "<group>"; };
-		10852AC914F906870004895D /* NSURLConnectionVCR.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NSURLConnectionVCR.m; sourceTree = "<group>"; };
+		10852AC714F906870004895D /* NSURLConnectionVCR-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSURLConnectionVCR-Prefix.pch"; sourceTree = "<group>"; };
 		10852AD014F906870004895D /* NSURLConnectionVCRTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NSURLConnectionVCRTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
 		10852AD114F906870004895D /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
-		10852AD914F906870004895D /* NSURLConnectionVCRTests-Info.plist */ = {isa = PBXFileReference; path = "NSURLConnectionVCRTests-Info.plist"; sourceTree = "<group>"; };
+		10852AD914F906870004895D /* NSURLConnectionVCRTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NSURLConnectionVCRTests-Info.plist"; sourceTree = "<group>"; };
 		10852ADB14F906870004895D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
-		10852ADD14F906870004895D /* NSURLConnectionVCRTests.h */ = {isa = PBXFileReference; path = NSURLConnectionVCRTests.h; sourceTree = "<group>"; };
+		10852ADD14F906870004895D /* NSURLConnectionVCRTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSURLConnectionVCRTests.h; sourceTree = "<group>"; };
 		10852ADE14F906870004895D /* NSURLConnectionVCRTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NSURLConnectionVCRTests.m; sourceTree = "<group>"; };
+		10852AE814F906A70004895D /* SKUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKUtils.h; sourceTree = "<group>"; };
+		10852AE914F906A70004895D /* SKUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SKUtils.mm; sourceTree = "<group>"; };
+		10852AEA14F906A70004895D /* NSURLConnectionVCR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSURLConnectionVCR.h; sourceTree = "<group>"; };
+		10852AEB14F906A70004895D /* NSURLConnectionVCR.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NSURLConnectionVCR.mm; sourceTree = "<group>"; };
+		10852AF814F9364D0004895D /* libprofile_rt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libprofile_rt.dylib; path = Toolchains/XcodeDefault.xctoolchain/usr/lib/libprofile_rt.dylib; sourceTree = DEVELOPER_DIR; };
+		10ACCB8014FBD73D007F9BB5 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; };
+		10ACCB8914FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook.qlgenerator */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NSURLConnectionVCRQuicklook.qlgenerator; sourceTree = BUILT_PRODUCTS_DIR; };
+		10ACCB8A14FBDA06007F9BB5 /* QuickLook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickLook.framework; path = System/Library/Frameworks/QuickLook.framework; sourceTree = SDKROOT; };
+		10ACCB8C14FBDA06007F9BB5 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; };
+		10ACCB8F14FBDA06007F9BB5 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
+		10ACCB9314FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "NSURLConnectionVCRQuicklook-Info.plist"; sourceTree = "<group>"; };
+		10ACCB9514FBDA06007F9BB5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		10ACCB9714FBDA06007F9BB5 /* GenerateThumbnailForURL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GenerateThumbnailForURL.m; sourceTree = "<group>"; };
+		10ACCB9914FBDA06007F9BB5 /* GeneratePreviewForURL.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GeneratePreviewForURL.m; sourceTree = "<group>"; };
+		10ACCB9B14FBDA06007F9BB5 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
+		10ACCB9D14FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSURLConnectionVCRQuicklook-Prefix.pch"; sourceTree = "<group>"; };
+		10ACCBA114FBDB11007F9BB5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				10ACCB8114FBD73D007F9BB5 /* CoreServices.framework in Frameworks */,
 				10852ABC14F906870004895D /* Cocoa.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				1031062A14FA83E600C9133A /* Security.framework in Frameworks */,
 				10852AD214F906870004895D /* SenTestingKit.framework in Frameworks */,
 				10852AD314F906870004895D /* Cocoa.framework in Frameworks */,
 				10852AD614F906870004895D /* NSURLConnectionVCR.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		10ACCB8414FBDA06007F9BB5 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				1007806814FBEC5C009362E5 /* AppKit.framework in Frameworks */,
+				1007806614FBEC26009362E5 /* WebKit.framework in Frameworks */,
+				10ACCBA214FBDB11007F9BB5 /* Foundation.framework in Frameworks */,
+				10ACCB8B14FBDA06007F9BB5 /* QuickLook.framework in Frameworks */,
+				10ACCB8D14FBDA06007F9BB5 /* ApplicationServices.framework in Frameworks */,
+				10ACCB8E14FBDA06007F9BB5 /* CoreServices.framework in Frameworks */,
+				10ACCB9014FBDA06007F9BB5 /* CoreFoundation.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		1083AD8014FA816E00ABF053 /* CocoaHTTPServer */ = {
+			isa = PBXGroup;
+			children = (
+				1083AD8314FA816E00ABF053 /* Core */,
+				1083AE5914FA816E00ABF053 /* Vendor */,
+			);
+			path = CocoaHTTPServer;
+			sourceTree = "<group>";
+		};
+		1083AD8314FA816E00ABF053 /* Core */ = {
+			isa = PBXGroup;
+			children = (
+				1083AD8414FA816E00ABF053 /* Categories */,
+				1083AD8B14FA816E00ABF053 /* HTTPAuthenticationRequest.h */,
+				1083AD8C14FA816E00ABF053 /* HTTPAuthenticationRequest.m */,
+				1083AD8D14FA816E00ABF053 /* HTTPConnection.h */,
+				1083AD8E14FA816E00ABF053 /* HTTPConnection.m */,
+				1083AD8F14FA816E00ABF053 /* HTTPLogging.h */,
+				1083AD9014FA816E00ABF053 /* HTTPMessage.h */,
+				1083AD9114FA816E00ABF053 /* HTTPMessage.m */,
+				1083AD9214FA816E00ABF053 /* HTTPResponse.h */,
+				1083AD9314FA816E00ABF053 /* HTTPServer.h */,
+				1083AD9414FA816E00ABF053 /* HTTPServer.m */,
+				1083AD9514FA816E00ABF053 /* Responses */,
+				1083ADA014FA816E00ABF053 /* WebSocket.h */,
+				1083ADA114FA816E00ABF053 /* WebSocket.m */,
+			);
+			path = Core;
+			sourceTree = "<group>";
+		};
+		1083AD8414FA816E00ABF053 /* Categories */ = {
+			isa = PBXGroup;
+			children = (
+				1083AD8514FA816E00ABF053 /* DDData.h */,
+				1083AD8614FA816E00ABF053 /* DDData.m */,
+				1083AD8714FA816E00ABF053 /* DDNumber.h */,
+				1083AD8814FA816E00ABF053 /* DDNumber.m */,
+				1083AD8914FA816E00ABF053 /* DDRange.h */,
+				1083AD8A14FA816E00ABF053 /* DDRange.m */,
+			);
+			path = Categories;
+			sourceTree = "<group>";
+		};
+		1083AD9514FA816E00ABF053 /* Responses */ = {
+			isa = PBXGroup;
+			children = (
+				1083AD9614FA816E00ABF053 /* HTTPAsyncFileResponse.h */,
+				1083AD9714FA816E00ABF053 /* HTTPAsyncFileResponse.m */,
+				1083AD9814FA816E00ABF053 /* HTTPDataResponse.h */,
+				1083AD9914FA816E00ABF053 /* HTTPDataResponse.m */,
+				1083AD9A14FA816E00ABF053 /* HTTPDynamicFileResponse.h */,
+				1083AD9B14FA816E00ABF053 /* HTTPDynamicFileResponse.m */,
+				1083AD9C14FA816E00ABF053 /* HTTPFileResponse.h */,
+				1083AD9D14FA816E00ABF053 /* HTTPFileResponse.m */,
+				1083AD9E14FA816E00ABF053 /* HTTPRedirectResponse.h */,
+				1083AD9F14FA816E00ABF053 /* HTTPRedirectResponse.m */,
+			);
+			path = Responses;
+			sourceTree = "<group>";
+		};
+		1083AE5914FA816E00ABF053 /* Vendor */ = {
+			isa = PBXGroup;
+			children = (
+				1083AE5A14FA816E00ABF053 /* CocoaAsyncSocket */,
+				1083AE5E14FA816E00ABF053 /* CocoaLumberjack */,
+			);
+			path = Vendor;
+			sourceTree = "<group>";
+		};
+		1083AE5A14FA816E00ABF053 /* CocoaAsyncSocket */ = {
+			isa = PBXGroup;
+			children = (
+				1083AE5B14FA816E00ABF053 /* About.txt */,
+				1083AE5C14FA816E00ABF053 /* GCDAsyncSocket.h */,
+				1083AE5D14FA816E00ABF053 /* GCDAsyncSocket.m */,
+			);
+			path = CocoaAsyncSocket;
+			sourceTree = "<group>";
+		};
+		1083AE5E14FA816E00ABF053 /* CocoaLumberjack */ = {
+			isa = PBXGroup;
+			children = (
+				1083AE5F14FA816E00ABF053 /* About.txt */,
+				1083AE6014FA816E00ABF053 /* DDASLLogger.h */,
+				1083AE6114FA816E00ABF053 /* DDASLLogger.m */,
+				1083AE6214FA816E00ABF053 /* DDAbstractDatabaseLogger.h */,
+				1083AE6314FA816E00ABF053 /* DDAbstractDatabaseLogger.m */,
+				1083AE6414FA816E00ABF053 /* DDFileLogger.h */,
+				1083AE6514FA816E00ABF053 /* DDFileLogger.m */,
+				1083AE6614FA816E00ABF053 /* DDLog.h */,
+				1083AE6714FA816E00ABF053 /* DDLog.m */,
+				1083AE6814FA816E00ABF053 /* DDTTYLogger.h */,
+				1083AE6914FA816E00ABF053 /* DDTTYLogger.m */,
+			);
+			path = CocoaLumberjack;
+			sourceTree = "<group>";
+		};
 		10852AAC14F906870004895D = {
 			isa = PBXGroup;
 			children = (
 				10852AC114F906870004895D /* NSURLConnectionVCR */,
 				10852AD714F906870004895D /* NSURLConnectionVCRTests */,
+				10ACCB9114FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook */,
 				10852ABA14F906870004895D /* Frameworks */,
 				10852AB914F906870004895D /* Products */,
 			);
 			children = (
 				10852AB814F906870004895D /* NSURLConnectionVCR.framework */,
 				10852AD014F906870004895D /* NSURLConnectionVCRTests.octest */,
+				10ACCB8914FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook.qlgenerator */,
 			);
 			name = Products;
 			sourceTree = "<group>";
 		10852ABA14F906870004895D /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
+				1007806714FBEC5C009362E5 /* AppKit.framework */,
+				1007806514FBEC26009362E5 /* WebKit.framework */,
+				10ACCBA114FBDB11007F9BB5 /* Foundation.framework */,
+				10ACCB8014FBD73D007F9BB5 /* CoreServices.framework */,
+				1031062914FA83E600C9133A /* Security.framework */,
+				10852AF814F9364D0004895D /* libprofile_rt.dylib */,
 				10852ABB14F906870004895D /* Cocoa.framework */,
 				10852AD114F906870004895D /* SenTestingKit.framework */,
+				10ACCB8A14FBDA06007F9BB5 /* QuickLook.framework */,
+				10ACCB8C14FBDA06007F9BB5 /* ApplicationServices.framework */,
+				10ACCB8F14FBDA06007F9BB5 /* CoreFoundation.framework */,
 				10852ABD14F906870004895D /* Other Frameworks */,
 			);
 			name = Frameworks;
 		10852AC114F906870004895D /* NSURLConnectionVCR */ = {
 			isa = PBXGroup;
 			children = (
-				10852AC814F906870004895D /* NSURLConnectionVCR.h */,
-				10852AC914F906870004895D /* NSURLConnectionVCR.m */,
+				10852AE814F906A70004895D /* SKUtils.h */,
+				10852AE914F906A70004895D /* SKUtils.mm */,
+				10852AEA14F906A70004895D /* NSURLConnectionVCR.h */,
+				10852AEB14F906A70004895D /* NSURLConnectionVCR.mm */,
 				10852AC214F906870004895D /* Supporting Files */,
 			);
 			path = NSURLConnectionVCR;
 			children = (
 				10852ADD14F906870004895D /* NSURLConnectionVCRTests.h */,
 				10852ADE14F906870004895D /* NSURLConnectionVCRTests.m */,
+				1083AD8014FA816E00ABF053 /* CocoaHTTPServer */,
 				10852AD814F906870004895D /* Supporting Files */,
 			);
 			path = NSURLConnectionVCRTests;
 			name = "Supporting Files";
 			sourceTree = "<group>";
 		};
+		10ACCB9114FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook */ = {
+			isa = PBXGroup;
+			children = (
+				1007806114FBE8B5009362E5 /* VCRGetPreview.h */,
+				1007806214FBE8B5009362E5 /* VCRGetPreview.m */,
+				10ACCB9714FBDA06007F9BB5 /* GenerateThumbnailForURL.m */,
+				10ACCB9914FBDA06007F9BB5 /* GeneratePreviewForURL.m */,
+				10ACCB9B14FBDA06007F9BB5 /* main.c */,
+				10ACCB9214FBDA06007F9BB5 /* Supporting Files */,
+			);
+			path = NSURLConnectionVCRQuicklook;
+			sourceTree = "<group>";
+		};
+		10ACCB9214FBDA06007F9BB5 /* Supporting Files */ = {
+			isa = PBXGroup;
+			children = (
+				10ACCB9314FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook-Info.plist */,
+				10ACCB9414FBDA06007F9BB5 /* InfoPlist.strings */,
+				10ACCB9D14FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook-Prefix.pch */,
+			);
+			name = "Supporting Files";
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXHeadersBuildPhase section */
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				10852AEC14F906A70004895D /* SKUtils.h in Headers */,
+				10852AEE14F906A70004895D /* NSURLConnectionVCR.h in Headers */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		10ACCB8514FBDA06007F9BB5 /* Headers */ = {
+			isa = PBXHeadersBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				1007806314FBE8B5009362E5 /* VCRGetPreview.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 			productReference = 10852AD014F906870004895D /* NSURLConnectionVCRTests.octest */;
 			productType = "com.apple.product-type.bundle";
 		};
+		10ACCB8814FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 10ACCB9E14FBDA06007F9BB5 /* Build configuration list for PBXNativeTarget "NSURLConnectionVCRQuicklook" */;
+			buildPhases = (
+				10ACCB8314FBDA06007F9BB5 /* Sources */,
+				10ACCB8414FBDA06007F9BB5 /* Frameworks */,
+				10ACCB8514FBDA06007F9BB5 /* Headers */,
+				10ACCB8614FBDA06007F9BB5 /* Resources */,
+				10ACCB8714FBDA06007F9BB5 /* Rez */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = NSURLConnectionVCRQuicklook;
+			productName = NSURLConnectionVCRQuicklook;
+			productReference = 10ACCB8914FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook.qlgenerator */;
+			productType = "com.apple.product-type.bundle";
+		};
 /* End PBXNativeTarget section */
 
 /* Begin PBXProject section */
 			isa = PBXProject;
 			attributes = {
 				LastUpgradeCheck = 0440;
+				ORGANIZATIONNAME = martijnthe.nl;
 			};
 			buildConfigurationList = 10852AB114F906870004895D /* Build configuration list for PBXProject "NSURLConnectionVCR" */;
 			compatibilityVersion = "Xcode 3.2";
 			hasScannedForEncodings = 0;
 			knownRegions = (
 				en,
+				English,
 			);
 			mainGroup = 10852AAC14F906870004895D;
 			productRefGroup = 10852AB914F906870004895D /* Products */;
 			projectRoot = "";
 			targets = (
 				10852AB714F906870004895D /* NSURLConnectionVCR */,
+				10ACCB8814FBDA06007F9BB5 /* NSURLConnectionVCRQuicklook */,
 				10852ACF14F906870004895D /* NSURLConnectionVCRTests */,
 			);
 		};
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		10ACCB8614FBDA06007F9BB5 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				10ACCB9614FBDA06007F9BB5 /* InfoPlist.strings in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 /* End PBXResourcesBuildPhase section */
 
+/* Begin PBXRezBuildPhase section */
+		10ACCB8714FBDA06007F9BB5 /* Rez */ = {
+			isa = PBXRezBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXRezBuildPhase section */
+
 /* Begin PBXShellScriptBuildPhase section */
 		10852ACE14F906870004895D /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				10852ACA14F906870004895D /* NSURLConnectionVCR.m in Sources */,
+				10852AED14F906A70004895D /* SKUtils.mm in Sources */,
+				10852AEF14F906A70004895D /* NSURLConnectionVCR.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 			buildActionMask = 2147483647;
 			files = (
 				10852ADF14F906870004895D /* NSURLConnectionVCRTests.m in Sources */,
+				1083AE9014FA816F00ABF053 /* DDData.m in Sources */,
+				1083AE9114FA816F00ABF053 /* DDNumber.m in Sources */,
+				1083AE9214FA816F00ABF053 /* DDRange.m in Sources */,
+				1083AE9314FA816F00ABF053 /* HTTPAuthenticationRequest.m in Sources */,
+				1083AE9414FA816F00ABF053 /* HTTPConnection.m in Sources */,
+				1083AE9514FA816F00ABF053 /* HTTPMessage.m in Sources */,
+				1083AE9614FA816F00ABF053 /* HTTPServer.m in Sources */,
+				1083AE9714FA816F00ABF053 /* HTTPAsyncFileResponse.m in Sources */,
+				1083AE9814FA816F00ABF053 /* HTTPDataResponse.m in Sources */,
+				1083AE9914FA816F00ABF053 /* HTTPDynamicFileResponse.m in Sources */,
+				1083AE9A14FA816F00ABF053 /* HTTPFileResponse.m in Sources */,
+				1083AE9B14FA816F00ABF053 /* HTTPRedirectResponse.m in Sources */,
+				1083AE9C14FA816F00ABF053 /* WebSocket.m in Sources */,
+				1083AEF414FA816F00ABF053 /* GCDAsyncSocket.m in Sources */,
+				1083AEF614FA816F00ABF053 /* DDASLLogger.m in Sources */,
+				1083AEF714FA816F00ABF053 /* DDAbstractDatabaseLogger.m in Sources */,
+				1083AEF814FA816F00ABF053 /* DDFileLogger.m in Sources */,
+				1083AEF914FA816F00ABF053 /* DDLog.m in Sources */,
+				1083AEFA14FA816F00ABF053 /* DDTTYLogger.m in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		10ACCB8314FBDA06007F9BB5 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				10ACCB9814FBDA06007F9BB5 /* GenerateThumbnailForURL.m in Sources */,
+				10ACCB9A14FBDA06007F9BB5 /* GeneratePreviewForURL.m in Sources */,
+				10ACCB9C14FBDA06007F9BB5 /* main.c in Sources */,
+				1007805E14FBE3A8009362E5 /* NSURLConnectionVCR.mm in Sources */,
+				1007806014FBE3B9009362E5 /* SKUtils.mm in Sources */,
+				1007806414FBE8B5009362E5 /* VCRGetPreview.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 			name = InfoPlist.strings;
 			sourceTree = "<group>";
 		};
+		10ACCB9414FBDA06007F9BB5 /* InfoPlist.strings */ = {
+			isa = PBXVariantGroup;
+			children = (
+				10ACCB9514FBDA06007F9BB5 /* en */,
+			);
+			name = InfoPlist.strings;
+			sourceTree = "<group>";
+		};
 /* End PBXVariantGroup section */
 
 /* Begin XCBuildConfiguration section */
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.8;
 				ONLY_ACTIVE_ARCH = YES;
-				SDKROOT = macosx;
+				SDKROOT = "";
 			};
 			name = Debug;
 		};
 				GCC_WARN_UNINITIALIZED_AUTOS = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.8;
-				SDKROOT = macosx;
+				SDKROOT = "";
 			};
 			name = Release;
 		};
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 1;
 				FRAMEWORK_VERSION = A;
+				GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+				GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "NSURLConnectionVCR/NSURLConnectionVCR-Prefix.pch";
 				INFOPLIST_FILE = "NSURLConnectionVCR/NSURLConnectionVCR-Info.plist";
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
+				GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+				GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "NSURLConnectionVCR/NSURLConnectionVCR-Prefix.pch";
+				GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "SRCROOT=$(SRCROOT)";
 				INFOPLIST_FILE = "NSURLConnectionVCRTests/NSURLConnectionVCRTests-Info.plist";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib\"",
+				);
+				OTHER_CFLAGS = (
+					"-ftest-coverage",
+					"-fprofile-arcs",
+				);
+				OTHER_LDFLAGS = "-lprofile_rt";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				WRAPPER_EXTENSION = octest;
 			};
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
+				GCC_GENERATE_TEST_COVERAGE_FILES = YES;
+				GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "NSURLConnectionVCR/NSURLConnectionVCR-Prefix.pch";
+				GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "SRCROOT=$(SRCROOT)";
 				INFOPLIST_FILE = "NSURLConnectionVCRTests/NSURLConnectionVCRTests-Info.plist";
+				LIBRARY_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib\"",
+				);
+				OTHER_CFLAGS = (
+					"-ftest-coverage",
+					"-fprofile-arcs",
+				);
+				OTHER_LDFLAGS = "-lprofile_rt";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				WRAPPER_EXTENSION = octest;
 			};
 			name = Release;
 		};
+		10ACCB9F14FBDA06007F9BB5 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "NSURLConnectionVCRQuicklook/NSURLConnectionVCRQuicklook-Prefix.pch";
+				INFOPLIST_FILE = "NSURLConnectionVCRQuicklook/NSURLConnectionVCRQuicklook-Info.plist";
+				INSTALL_PATH = /Library/QuickLook;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = macosx;
+				WRAPPER_EXTENSION = qlgenerator;
+			};
+			name = Debug;
+		};
+		10ACCBA014FBDA06007F9BB5 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = "NSURLConnectionVCRQuicklook/NSURLConnectionVCRQuicklook-Prefix.pch";
+				INFOPLIST_FILE = "NSURLConnectionVCRQuicklook/NSURLConnectionVCRQuicklook-Info.plist";
+				INSTALL_PATH = /Library/QuickLook;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SDKROOT = macosx;
+				WRAPPER_EXTENSION = qlgenerator;
+			};
+			name = Release;
+		};
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
 				10852AE414F906870004895D /* Release */,
 			);
 			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
 		};
 		10852AE514F906870004895D /* Build configuration list for PBXNativeTarget "NSURLConnectionVCRTests" */ = {
 			isa = XCConfigurationList;
 				10852AE714F906870004895D /* Release */,
 			);
 			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		10ACCB9E14FBDA06007F9BB5 /* Build configuration list for PBXNativeTarget "NSURLConnectionVCRQuicklook" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				10ACCB9F14FBDA06007F9BB5 /* Debug */,
+				10ACCBA014FBDA06007F9BB5 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
 		};
 /* End XCConfigurationList section */
 	};

NSURLConnectionVCR.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:NSURLConnectionVCR.xcodeproj">
+   </FileRef>
+</Workspace>

NSURLConnectionVCR.xcodeproj/xcshareddata/xcschemes/NSURLConnectionVCR.xcscheme

+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "10852AB714F906870004895D"
+               BuildableName = "NSURLConnectionVCR.framework"
+               BlueprintName = "NSURLConnectionVCR"
+               ReferencedContainer = "container:NSURLConnectionVCR.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "10852ACF14F906870004895D"
+               BuildableName = "NSURLConnectionVCRTests.octest"
+               BlueprintName = "NSURLConnectionVCRTests"
+               ReferencedContainer = "container:NSURLConnectionVCR.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      buildConfiguration = "Debug">
+      <Testables>
+         <TestableReference
+            skipped = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "10852ACF14F906870004895D"
+               BuildableName = "NSURLConnectionVCRTests.octest"
+               BlueprintName = "NSURLConnectionVCRTests"
+               ReferencedContainer = "container:NSURLConnectionVCR.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+      </Testables>
+   </TestAction>
+   <LaunchAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      buildConfiguration = "Debug"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      allowLocationSimulation = "YES">
+      <PathRunnable
+         FilePath = "/Applications/Xcode.app/Contents/Developer/Tools/otest">
+      </PathRunnable>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "10852ACF14F906870004895D"
+            BuildableName = "NSURLConnectionVCRTests.octest"
+            BlueprintName = "NSURLConnectionVCRTests"
+            ReferencedContainer = "container:NSURLConnectionVCR.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <CommandLineArguments>
+         <CommandLineArgument
+            argument = "-SenTest All"
+            isEnabled = "YES">
+         </CommandLineArgument>
+         <CommandLineArgument
+            argument = "$(SRCROOT)/$(CONFIGURATION_BUILD_DIR)/$(FULL_PRODUCT_NAME)"
+            isEnabled = "YES">
+         </CommandLineArgument>
+      </CommandLineArguments>
+      <EnvironmentVariables>
+         <EnvironmentVariable
+            key = "OBJC_DISABLE_GC"
+            value = "YES"
+            isEnabled = "YES">
+         </EnvironmentVariable>
+      </EnvironmentVariables>
+      <AdditionalOptions>
+         <AdditionalOption
+            key = "NSZombieEnabled"
+            value = "YES"
+            isEnabled = "YES">
+         </AdditionalOption>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = "/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Resources/templates/Leaks.tracetemplate"
+      useCustomWorkingDirectory = "NO"
+      buildConfiguration = "Debug"
+      debugDocumentVersioning = "YES">
+      <PathRunnable
+         FilePath = "/Applications/Xcode.app/Contents/Developer/Tools/otest">
+      </PathRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

NSURLConnectionVCR.xcodeproj/xcshareddata/xcschemes/NSURLConnectionVCRQuicklook.xcscheme

+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "10ACCB8814FBDA06007F9BB5"
+               BuildableName = "NSURLConnectionVCRQuicklook.qlgenerator"
+               BlueprintName = "NSURLConnectionVCRQuicklook"
+               ReferencedContainer = "container:NSURLConnectionVCR.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      buildConfiguration = "Debug">
+      <Testables>
+      </Testables>
+   </TestAction>
+   <LaunchAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      buildConfiguration = "Debug"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      allowLocationSimulation = "YES">
+      <PathRunnable
+         FilePath = "/System/Library/Frameworks/QuickLook.framework/Versions/A/Resources/quicklookd.app/Contents/MacOS/qlmanage">
+      </PathRunnable>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "10ACCB8814FBDA06007F9BB5"
+            BuildableName = "NSURLConnectionVCRQuicklook.qlgenerator"
+            BlueprintName = "NSURLConnectionVCRQuicklook"
+            ReferencedContainer = "container:NSURLConnectionVCR.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <CommandLineArguments>
+         <CommandLineArgument
+            argument = "-p &quot;$(SRCROOT)/NSURLConnectionVCRTests/VCRTapes/3BE7EE88992C73C5A003BE0E36AC1F14.vcr&quot;"
+            isEnabled = "YES">
+         </CommandLineArgument>
+         <CommandLineArgument
+            argument = "-c &quot;application/x-plist+vcr&quot;"
+            isEnabled = "YES">
+         </CommandLineArgument>
+         <CommandLineArgument
+            argument = "-g &quot;$(SRCROOT)/$(CONFIGURATION_BUILD_DIR)/$(WRAPPER_NAME)&quot;"
+            isEnabled = "YES">
+         </CommandLineArgument>
+         <CommandLineArgument
+            argument = "-d 4"
+            isEnabled = "YES">
+         </CommandLineArgument>
+      </CommandLineArguments>
+      <AdditionalOptions>
+         <AdditionalOption
+            key = "NSZombieEnabled"
+            value = "YES"
+            isEnabled = "YES">
+         </AdditionalOption>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      buildConfiguration = "Release"
+      debugDocumentVersioning = "YES">
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

NSURLConnectionVCR/NSURLConnectionVCR.h

 
 #import <Foundation/Foundation.h>
 
+extern NSString* NSURLConnectionVCRErrorDomain;
+
+enum NSURLConnectionVCRErrorCodes {
+    NSURLConnectionVCRErrorAlreadyStarted = 0x8BADF00D,
+    NSURLConnectionVCRErrorAlreadyStopped,
+    NSURLConnectionVCRErrorCouldNotCreateDirectory,
+    NSURLConnectionVCRErrorPathIsNotADirectory,
+    NSURLConnectionVCRErrorStorageFailed,
+};
+
+
 /**
  *  NSURLConnectionVCR provides a way to re-play NSURLConnection HTTP responses.
  *  It is inspired on Ruby's VCR.
  */
 
-extern NSString* NSURLConnectionVCRErrorDomain;
+@interface NSURLConnectionVCR : NSObject
 
-enum NSURLConnectionVCRErrorCodes {
-    NSURLConnectionVCRErrorAlreadyStarted,
-    NSURLConnectionVCRErrorAlreadyStopped
-};
 
-@interface NSURLConnectionVCR : NSObject
+/**
+ *	Start the VCR.
+ *	@param path VCR will use this path to store and retrieve caches.
+ *	@param error On input, a pointer to an error object.
+ *	@returns YES if VCR was started successfully, and NO in case of an error.
+ *  @see NSURLConnectionVCRErrorCodes for error codes that are used in assigned error objects.
+ */
 + (BOOL)startVCRWithPath:(NSString*)path error:(NSError**)error;
+
+
+/**
+ *	Stop the VCR.
+ *	@param error On input, a pointer to an error object.
+ *	@returns YES if VCR was stopped successfully, and NO in case of an error.
+ *  @see NSURLConnectionVCRErrorCodes for error codes that are used in assigned error objects.
+ */
 + (BOOL)stopVCRWithError:(NSError**)error;
+
+
+/**
+ *	@returns YES if VCR is running, NO if it is stopped.
+ */
 + (BOOL)isVCRStarted;
+
+
+/**
+ *	Set the path where VCR will store and retrieve caches.
+ *	@param path VCR will use this path to store and retrieve caches.
+ *	@param error On input, a pointer to an error object.
+ *	@returns YES if the path was set successfully, and NO in case of an error.
+ *  @see NSURLConnectionVCRErrorCodes for error codes that are used in assigned error objects.
+ */
++ (BOOL)setPath:(NSString*)path error:(NSError **)error;
+
+
+/**
+ *	@returns The currently set path where VCR will store and retrieve caches.
+ */
++ (NSString*)path;
+
+
+/**
+ *	Returns a Boolean value that indicates whether VCR can find a
+ *  cache for the given request at the currently set path.
+ *	@param request The request of which VCR needs to check its existence
+ *	@returns YES if a cache for request can be found at the currently set path, NO if there was none.
+ *  @see +setPath:error:
+ *  @see +path
+ */
++ (BOOL)hasCacheForRequest:(NSURLRequest*)request;
+
+
+/**
+ *	Deletes the cache (if existing) for the given request at the currently active path.
+ *	@param request The request for which the cache will be deleted.
+ *	@param error On input, a pointer to an error object.
+ *	@returns YES if the cache was successfully deleted, or NO if an error occured.
+ *  @see NSURLConnectionVCRErrorCodes for error codes that are used in assigned error objects.
+ *  @see +setPath:error:
+ *  @see +path
+ */
++ (BOOL)deleteCacheForRequest:(NSURLRequest*)request error:(NSError**)error;
+
 @end

NSURLConnectionVCR/NSURLConnectionVCR.mm

 #import "SKUtils.h"
 #import <CommonCrypto/CommonDigest.h>
 #import <objc/runtime.h>
- 
+#import <objc/objc.h>
+#import <CoreServices/CoreServices.h>
+
 NSString* NSURLConnectionVCRErrorDomain = @"NSURLConnectionVCRErrorDomain";
 struct objc_class;
 __strong static NSString* casettesPath;
 
+#pragma mark - Private Interfaces
 
 @interface VCRCache : NSObject <NSCoding>
 @property (nonatomic, readwrite, strong) NSURLResponse* response;
 @property (nonatomic, readwrite, strong) NSData* responseBody;
 + (VCRCache*)loadCacheForRequest:(NSURLRequest*)request;
-+ (BOOL)storeResponse:(NSURLResponse*)response withResponseBody:(NSData*)data forRequest:(NSURLRequest*)request;
++ (VCRCache*)storeResponse:(NSURLResponse*)response withResponseBody:(NSData*)data forRequest:(NSURLRequest*)request success:(out BOOL*)outSuccess;
++ (BOOL)deleteCacheForRequest:(NSURLRequest*)request error:(NSError *__autoreleasing *)error;
++ (BOOL)hasCacheForRequest:(NSURLRequest*)request;
 @end
 
+@class VCRConnectionDelegate;
 
 @interface NSURLConnectionVCR ()
-@property (nonatomic, retain, readwrite) NSURLConnection* origConnection;
+@property (nonatomic, retain, readwrite) NSURLConnection* connection;
+@property (nonatomic, retain, readwrite) VCRConnectionDelegate* delegate;
+@end
+
+@interface VCRConnectionDelegate : NSObject
+@property (nonatomic, retain, readwrite) id realDelegate;
+@property (nonatomic, retain, readwrite) NSURLConnectionVCR *vcr;
+@property (nonatomic, retain, readwrite) NSURLRequest* request;
+@property (nonatomic, retain, readonly) NSURLResponse* response;
+@property (nonatomic, retain, readonly) NSData* responseData;
+@end
+
+@interface VCRCache (Private)
++ (NSString*)hashForRequest:(NSURLRequest*)request;
++ (NSString*)filePathForRequest:(NSURLRequest*)request;
 @end
 
 
+#pragma mark - NSURLConnectionVCR Implementation
+
 @implementation NSURLConnectionVCR {
-    NSURLConnection* origConnection;
+    NSURLConnection* connection;
+    VCRConnectionDelegate* delegate;
+}
+
+#pragma mark General stuff
+@synthesize connection;
+@synthesize delegate;
+
+- (void)dealloc {
+    connection = nil;
+    delegate = nil;
+}
+
++ (BOOL)setPath:(NSString*)path error:(NSError *__autoreleasing *)error {
+    if (path != nil) {
+        NSFileManager* fm = [NSFileManager defaultManager];
+        BOOL isDirectory;
+        BOOL fileExists = [fm fileExistsAtPath:path isDirectory:&isDirectory];
+        if (fileExists == NO) {
+            NSError* createDirError = nil;
+            BOOL didCreateDir = [fm createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&createDirError];
+            if (didCreateDir == NO) {
+                if (error) {
+                    NSDictionary* userInfo = [NSDictionary dictionaryWithObjectsAndKeys:createDirError, NSUnderlyingErrorKey, nil];
+                    *error = [NSError errorWithDomain:NSURLConnectionVCRErrorDomain code:NSURLConnectionVCRErrorCouldNotCreateDirectory userInfo:userInfo];
+                }
+                return NO;
+            }
+        } else if (isDirectory == NO) {
+            if (error) {
+                *error = [NSError errorWithDomain:NSURLConnectionVCRErrorDomain code:NSURLConnectionVCRErrorPathIsNotADirectory userInfo:nil];
+            }
+            return NO;
+        }
+    }
+    casettesPath = path;
+    return YES;
+}
+
++ (NSString*)path {
+    return casettesPath;
+}
+
++ (BOOL)deleteCacheForRequest:(NSURLRequest*)request error:(NSError *__autoreleasing *)error {
+    return [VCRCache deleteCacheForRequest:request error:error];
 }
-@synthesize origConnection;
 
-static IMP allocImplementationOrig = NULL;
-static id VCRAllocImplementation(id theSelf, SEL cmd, ...) {
-    NSURLConnectionVCR* vcr = [NSURLConnectionVCR alloc];
-    // Call original +alloc method:
-    NSURLConnection* origConn = allocImplementationOrig(theSelf, cmd);
-    [vcr setOrigConnection:origConn];
-    return vcr;
++ (BOOL)hasCacheForRequest:(NSURLRequest*)request {
+    return [VCRCache hasCacheForRequest:request];
 }
 
 + (BOOL)startVCRWithPath:(NSString*)path error:(NSError *__autoreleasing *)error {
         }
         return NO;
     } else {
-        Class connectionClass = NSClassFromString(@"NSURLConnection");
-        Class connectionMetaClass = objc_getMetaClass("NSURLConnection");
-        Method origMethod = class_getClassMethod(connectionClass, @selector(alloc));
-        allocImplementationOrig = method_getImplementation(origMethod);
-        class_replaceMethod(connectionMetaClass, @selector(alloc), VCRAllocImplementation, "@@:");        
-        
-        casettesPath = path;
-        
-        return YES;
+        if ([self setPath:path error:error] == NO) {
+            // We're not wrapping the error, would be overkill.
+            return NO;
+        } else {
+            // Swizzle the class methods we want to intercept (instance methods of the metaClasses):
+            Class connectionMetaClass = objc_getMetaClass("NSURLConnection");
+            Class connectionClass = objc_getClass("NSURLConnection");
+            Method origMethod;
+            IMP poseImplementation;
+            SEL theSelector;
+            Class theClass;
+            origImps = (IMP*)malloc(swizzleCount * sizeof(IMP));
+            
+            for (uint8 i = 0; i < swizzleCount; ++i) {
+                theSelector = swizzles[i].sel;
+                theClass = swizzles[i].isClassMethod ? connectionMetaClass : connectionClass;
+                origMethod = class_getInstanceMethod(theClass, theSelector);
+                origImps[i] = method_getImplementation(origMethod);
+                poseImplementation = imp_implementationWithBlock(poseImplementationBlockForSelector(theSelector));
+                class_replaceMethod(theClass, theSelector, poseImplementation, method_getTypeEncoding(origMethod));
+            }
+            return YES;
+        }
     }
 }
 
         }
         return NO;
     } else {
+        Method theMethod;
         Class connectionMetaClass = objc_getMetaClass("NSURLConnection");
-        class_replaceMethod(connectionMetaClass, @selector(alloc), allocImplementationOrig, "@@:");        
-        allocImplementationOrig = NULL;
-        
+        Class connectionClass = objc_getClass("NSURLConnection");
+        SEL theSelector;
+        Class theClass;
+        IMP previousImp;
+
+        for (uint8 i = 0; i < swizzleCount; ++i) {
+            theSelector = swizzles[i].sel;
+            theClass = swizzles[i].isClassMethod ? connectionMetaClass : connectionClass;
+            theMethod = class_getInstanceMethod(theClass, theSelector);
+            previousImp = class_replaceMethod(theClass, theSelector, origImps[i], method_getTypeEncoding(theMethod));
+            imp_removeBlock(previousImp);
+            origImps[i] = NULL;
+        }
+        free(origImps);
+        origImps = NULL;
         casettesPath = nil;
-        
         return YES;
     }
 }
 
 + (BOOL)isVCRStarted {
-    return (allocImplementationOrig != NULL);
+    return (origImps != NULL);
+}
+
+#pragma mark Class posing / Swizzle bizz
+
+struct swizzle {
+    SEL sel;
+    BOOL isClassMethod;
+};
+
+static const uint8 swizzleCount = 3;
+static struct swizzle swizzles[swizzleCount] = {
+    {@selector(alloc), YES},
+    {@selector(sendSynchronousRequest:returningResponse:error:), YES},
+    {@selector(sendAsynchronousRequest:queue:completionHandler:), YES}
+};
+
+static IMP *origImps = NULL;
+
+static id poseImplementationBlockForSelector(SEL sel) {
+    if (sel == @selector(alloc)) {
+        return (id)^(id _self) __attribute__((ns_returns_retained)) { /* the ns_returns_retained attribute is important here, because the +alloc method is expected to return +1 */
+            NSURLConnectionVCR *vcr = [NSURLConnectionVCR alloc];
+            // This call to the original +alloc IMP is wrapped in objc_retainedObject, because ARC gets confused otherwise...
+            id connection = objc_retainedObject((__bridge objc_objectptr_t)origImps[0](_self, sel));
+            vcr.connection = connection;
+            return vcr;
+        };
+    } else if (sel == @selector(sendSynchronousRequest:returningResponse:error:)) {
+        return (id)^(id _self, NSURLRequest* request, NSURLResponse *__autoreleasing *response, NSError *__autoreleasing *error) {
+            VCRCache *cache = [VCRCache loadCacheForRequest:request];
+            if (cache == nil) {
+                __autoreleasing NSURLResponse *theResponse = nil;
+                __autoreleasing NSError *theError = nil;
+                BOOL success;
+                NSData *theResponseBody = (NSData*)origImps[1](_self, sel, request, &theResponse, &theError);
+                cache = [VCRCache storeResponse:theResponse withResponseBody:theResponseBody forRequest:request success:&success];
+                if (error && theError) {
+                    *error = theError;
+                } else if (error && success == NO) { /* If the previous condition was true, this next condition is not very interesting any more, hence `else if`: */
+                    *error = [NSError errorWithDomain:NSURLConnectionVCRErrorDomain code:NSURLConnectionVCRErrorStorageFailed userInfo:nil];
+                }
+            }
+            if (response) {
+                *response = cache.response;
+            }
+            return cache.responseBody;
+        };
+    } else if (sel == @selector(sendAsynchronousRequest:queue:completionHandler:)) {
+        return (id)^(id _self, NSURLRequest *request, NSOperationQueue *queue, void (^handler)(NSURLResponse*, NSData*, NSError*) ) {
+            __block VCRCache *cache = [VCRCache loadCacheForRequest:request];
+            if (cache == nil) {
+                origImps[2](_self, sel, request, queue, ^(NSURLResponse *response, NSData *data, NSError *error){
+                    cache = [VCRCache storeResponse:response withResponseBody:data forRequest:request success:NULL];
+                    handler(cache.response, cache.responseBody, error);
+                });
+            } else {
+                handler(cache.response, cache.responseBody, nil);
+            }
+        };
+    } else {
+        return nil;
+    }
 }
 
 - (BOOL)respondsToSelector:(SEL)aSelector {
-    return [origConnection respondsToSelector:aSelector];
+    return [connection respondsToSelector:aSelector];
 }
 
-- (void)doesNotRecognizeSelector:(SEL)aSelector {
-    
++ (BOOL)instancesRespondToSelector:(SEL)aSelector {
+    return [NSURLConnection instancesRespondToSelector:aSelector];
 }
 
 - (id)forwardingTargetForSelector:(SEL)aSelector {
-    return origConnection;
+    return connection;
+}
+
+- (id)initWithRequest:(NSURLRequest *)request delegate:(id)realDelegate startImmediately:(BOOL)startImmediately {
+    VCRCache* cache = [VCRCache loadCacheForRequest:request];
+    if (cache) {
+        NSOperationQueue* queue = [NSOperationQueue currentQueue];
+        [queue addOperationWithBlock:^{
+            // yes, we want self and realDelegate to be retained by this block...
+            // it's perhaps a bit unnatural to call these delegate methods right after each other, but let's see if it is sufficient.
+            [realDelegate connection:(NSURLConnection*)self didReceiveResponse:cache.response];
+            NSUInteger loc = 0;
+            NSUInteger len = 256u * 1024u;
+            NSUInteger totalLen = [cache.responseBody length];
+            do {
+                if (len + loc > totalLen) {
+                    len = totalLen - loc;
+                }
+                NSData* subData = [cache.responseBody subdataWithRange:NSMakeRange(loc, len)];
+                [realDelegate connection:(NSURLConnection*)self didReceiveData:subData];
+                loc += len;
+            } while (loc < totalLen);
+            [realDelegate connectionDidFinishLoading:(NSURLConnection*)self];
+        }];
+        return [self init];
+    } else {
+        // NSURLConnection retains its delegate until done loading --> VCRConnectionDelegate retains realDelegate, vcr, request until done loading
+        delegate = [[VCRConnectionDelegate alloc] init];
+        delegate.realDelegate = realDelegate;
+        delegate.request = request;
+        delegate.vcr = self;
+        if ([connection initWithRequest:request delegate:delegate startImmediately:startImmediately]) {};  // wrapped in if() to silence `Expression result unused` compiler warning
+        return [self init];
+    }
+}
+
+- (id)initWithRequest:(NSURLRequest *)request delegate:(id)realDelegate {
+    return [self initWithRequest:request delegate:delegate startImmediately:YES];
 }
 
-- (void)forwardInvocation:(NSInvocation *)anInvocation {
-    
+- (id)delegate {
+    return [delegate realDelegate];
 }
 
 @end
 
 
-@interface VCRCache (Private)
-+ (NSString*)hashForRequest:(NSURLRequest*)request;
-+ (NSString*)filePathForRequest:(NSURLRequest*)request;
+@implementation VCRConnectionDelegate {
+    __strong NSObject<NSURLConnectionDelegate, NSURLConnectionDataDelegate, NSURLConnectionDownloadDelegate, NSObject>* realDelegate;
+    NSURLConnectionVCR* vcr;
+    NSURLRequest* request;
+    NSURLResponse* response;
+    NSMutableData* responseData;
+}
+@synthesize realDelegate;
+@synthesize vcr;
+@synthesize response;
+@synthesize responseData;
+@synthesize request;
+
+- (BOOL)respondsToSelector:(SEL)aSelector {
+    return [realDelegate respondsToSelector:aSelector];
+}
+
++ (BOOL)instancesRespondToSelector:(SEL)aSelector {
+//    return [theClass instancesRespondToSelector:aSelector];
+    return YES;
+}
+
+- (id)forwardingTargetForSelector:(SEL)aSelector {
+    return realDelegate;
+}
+
+- (void)releaseChildren {
+    realDelegate = nil;
+    vcr.connection = nil;
+    vcr = nil;
+    request = nil;
+}
+
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)theError {
+    [realDelegate connection:connection didFailWithError:theError];
+    [self releaseChildren];
+}
+
+- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)theResponse {
+    response = theResponse;
+    [realDelegate connection:connection didReceiveResponse:theResponse];
+}
+
+- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
+    if (responseData == nil) {
+        long long expectedContentLength = [response expectedContentLength];
+        responseData = [NSMutableData dataWithCapacity:expectedContentLength];
+    }
+    [responseData appendData:data];
+    [realDelegate connection:connection didReceiveData:data];
+}
+
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
+    [VCRCache storeResponse:response withResponseBody:responseData forRequest:request success:NULL];
+    [realDelegate connectionDidFinishLoading:connection];
+    [self releaseChildren];
+}
+
+- (void)connectionDidFinishDownloading:(NSURLConnection *)connection destinationURL:(NSURL *) destinationURL {
+    [VCRCache storeResponse:response withResponseBody:[NSData dataWithContentsOfURL:destinationURL] forRequest:request success:NULL];
+    [realDelegate connectionDidFinishDownloading:connection destinationURL:destinationURL];
+    [self releaseChildren];
+}
+
 @end
 
 
+#pragma mark - VCRCache (Tape) Implementation
+
 @implementation VCRCache
 @synthesize response;
 @synthesize responseBody;
 
 + (VCRCache*)loadCacheForRequest:(NSURLRequest*)request {
+    if (request == nil) {
+        return nil;
+    }
     VCRCache* cache = [NSKeyedUnarchiver unarchiveObjectWithFile:[self filePathForRequest:request]];
     return cache;
 }
 
-+ (BOOL)storeResponse:(NSURLResponse*)response withResponseBody:(NSData*)data forRequest:(NSURLRequest*)request {
-    VCRCache* cache = [[VCRCache alloc] init];
-    cache.response = response;
-    cache.responseBody = data;
-    return [NSKeyedArchiver archiveRootObject:cache toFile:[self filePathForRequest:request]];
++ (VCRCache*)storeResponse:(NSURLResponse*)response withResponseBody:(NSData*)data forRequest:(NSURLRequest*)request success:(out BOOL*)outSuccess {
+    BOOL success;
+    VCRCache* cache = nil;
+    if (request == nil) {
+        success = NO;
+    } else {
+        cache = [[VCRCache alloc] init];
+        cache.response = response;
+        cache.responseBody = data;
+        NSString* filePath = [self filePathForRequest:request];
+        success = [NSKeyedArchiver archiveRootObject:cache toFile:filePath];
+//        if (success) {
+//            // Trigger Spotlight to create metadata, so one can see what request URL the cache file belongs to
+//            MDItemCreate(NULL, (__bridge CFStringRef)filePath);
+//        }
+    }
+    if (outSuccess) {
+        *outSuccess = success;
+    }
+    return cache;
+}
+
++ (BOOL)deleteCacheForRequest:(NSURLRequest*)request error:(NSError *__autoreleasing *)error {
+    NSString* filePath = [self filePathForRequest:request];
+    NSFileManager* fm = [NSFileManager defaultManager];
+    // We're not wrapping the error, would be overkill.
+    return [fm removeItemAtPath:filePath error:error];
+}
+
++ (BOOL)hasCacheForRequest:(NSURLRequest*)request {
+    return [[NSFileManager defaultManager] fileExistsAtPath:[VCRCache filePathForRequest:request]];
 }
 
 - (id)initWithCoder:(NSCoder *)coder {
 }
 
 + (NSString*)filePathForRequest:(NSURLRequest*)request {
-    NSString* filePath = [casettesPath stringByAppendingPathComponent:[self hashForRequest:request]];
+    NSString* fileName = [[self hashForRequest:request] stringByAppendingPathExtension:@"vcr"];
+    NSString* filePath = [[NSURLConnectionVCR path] stringByAppendingPathComponent:fileName];
     return filePath;
 }
 

NSURLConnectionVCR/SKUtils.mm

         ++ptr;
         ++bytes;
         if (ptr == last) {
-            return (__bridge_retained CFStringRef)[[NSString alloc] initWithBytesNoCopy:c length:length * 2 encoding:NSUTF8StringEncoding freeWhenDone:NO];
+            return (__bridge_retained CFStringRef)[[NSString alloc] initWithBytesNoCopy:c length:length * 2 encoding:NSUTF8StringEncoding freeWhenDone:YES];
             
             // Not implemented in Cocotron:
 //            return CFStringCreateWithBytesNoCopy(NULL, c, length * 2, kCFStringEncodingUTF8, false, kCFAllocatorMalloc);

NSURLConnectionVCRQuicklook/GeneratePreviewForURL.m

 #include <CoreFoundation/CoreFoundation.h>
 #include <CoreServices/CoreServices.h>
 #include <QuickLook/QuickLook.h>
+#import "VCRGetPreview.h"
 
 OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options);
-void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview);
+//void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview);
 
-/* -----------------------------------------------------------------------------
-   Generate a preview for file
 
-   This function's job is to create preview for designated file
-   ----------------------------------------------------------------------------- */
-
-OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options)
-{
-    // To complete your generator please implement the function GeneratePreviewForURL in GeneratePreviewForURL.c
-    return noErr;
+OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options) {
+    NSData* responseData = nil;
+    NSString* displayName = nil;
+    NSString* textEncoding = nil;
+    NSString* mimeType = nil;
+    NSString* UTType = nil;
+    
+    OSStatus status = VCRGetPreviewData((__bridge NSURL*)url, &responseData, NULL, &displayName, &mimeType, &UTType, &textEncoding);
+    
+    if (status == noErr && displayName && textEncoding && responseData && UTType) {
+        NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
+        [props setObject:displayName forKey:(NSString*)kQLPreviewPropertyDisplayNameKey];
+        [props setObject:textEncoding forKey:(NSString *)kQLPreviewPropertyTextEncodingNameKey];
+        QLPreviewRequestSetDataRepresentation(preview, (__bridge CFDataRef)responseData, (__bridge CFStringRef)UTType, (__bridge CFDictionaryRef)props);
+        return noErr;
+    } else {
+        return -1;
+    }
 }
 
-void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview)
-{
-    // Implement only if supported
-}
+//void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview)
+//{
+//    // Implement only if supported
+//}

NSURLConnectionVCRQuicklook/GenerateThumbnailForURL.m

+#import <AppKit/AppKit.h>
+#import <WebKit/WebKit.h>
 #include <CoreFoundation/CoreFoundation.h>
 #include <CoreServices/CoreServices.h>
 #include <QuickLook/QuickLook.h>
+#import "VCRGetPreview.h"
 
 OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thumbnail, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options, CGSize maxSize);
-void CancelThumbnailGeneration(void *thisInterface, QLThumbnailRequestRef thumbnail);
+//void CancelThumbnailGeneration(void *thisInterface, QLThumbnailRequestRef thumbnail);
 
-/* -----------------------------------------------------------------------------
-    Generate a thumbnail for file
 
-   This function's job is to create thumbnail for designated file as fast as possible
-   ----------------------------------------------------------------------------- */
+OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thumbnail, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options, CGSize maxSize) {    
+    NSData* responseData = nil;
+    NSURLResponse* response = nil;
+    NSString* textEncoding = nil;
+    NSString* mimeType = nil;
+    
+    __block OSStatus status = VCRGetPreviewData((__bridge NSURL*)url, &responseData, &response, NULL, &mimeType, NULL, &textEncoding);
+    
+    if (status == noErr && responseData && response && mimeType && textEncoding) {
+		NSRect viewRect = NSMakeRect(0.0, 0.0, 600.0, 800.0);
+		float scale = maxSize.height / 800.0;
+		NSSize scaleSize = NSMakeSize(scale, scale);
+		CGSize thumbSize = NSSizeToCGSize(NSMakeSize((maxSize.width * (600.0/800.0)), maxSize.height));
+        
+		dispatch_sync(dispatch_get_main_queue(), ^{
+            NSURL* originalURL = [response URL];
+            WebView* webView = [[WebView alloc] initWithFrame: viewRect];
+            [webView scaleUnitSquareToSize: scaleSize];
+            [[[webView mainFrame] frameView] setAllowsScrolling:NO];
+            [[webView mainFrame] loadData:responseData MIMEType:mimeType textEncodingName:textEncoding baseURL:[originalURL URLByDeletingLastPathComponent]];
 
-OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thumbnail, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options, CGSize maxSize)
-{
-    // To complete your generator please implement the function GenerateThumbnailForURL in GenerateThumbnailForURL.c
-    return noErr;
-}
+            while ([webView isLoading]) {
+              CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
+            }
+
+            [webView display];
 
-void CancelThumbnailGeneration(void *thisInterface, QLThumbnailRequestRef thumbnail)
-{
-    // Implement only if supported
+            CGContextRef context = QLThumbnailRequestCreateContext(thumbnail, thumbSize, false, NULL);
+
+            if (context) {
+                NSGraphicsContext* nsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:(void*)context flipped:[webView isFlipped]];
+                [webView displayRectIgnoringOpacity:[webView bounds] inContext:nsContext];
+                QLThumbnailRequestFlushContext(thumbnail, context);
+                CFRelease(context);
+                status = noErr;
+            } else {
+                status = -2;
+            }
+        });
+        return status;
+	} else {
+        return -1;
+    }
 }
+
+//void CancelThumbnailGeneration(void *thisInterface, QLThumbnailRequestRef thumbnail)
+//{
+//    // Implement only if supported
+//}

NSURLConnectionVCRQuicklook/NSURLConnectionVCRQuicklook-Info.plist

 		<dict>
 			<key>CFBundleTypeRole</key>
 			<string>QLGenerator</string>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>application/x-plist+vcr</string>
+			</array>
 			<key>LSItemContentTypes</key>
 			<array>
-				<string>SUPPORTED_UTI_TYPE</string>
+				<string>nl.martijnthe.vcr</string>
 			</array>
 		</dict>
 	</array>
 	<key>CFPlugInUnloadFunction</key>
 	<string></string>
 	<key>NSHumanReadableCopyright</key>
-	<string>Copyright © 2012 __MyCompanyName__. All rights reserved.</string>
+	<string>Copyright © 2012 martijnthe.nl All rights reserved.</string>
 	<key>QLNeedsToBeRunInMainThread</key>
 	<false/>
 	<key>QLPreviewHeight</key>
 	<false/>
 	<key>QLThumbnailMinimumSize</key>
 	<real>17</real>
+	<key>UTImportedTypeDeclarations</key>
+	<array>
+		<dict>
+			<key>UTTypeReferenceURL</key>
+			<string>http://www.martijnthe.nl/</string>
+			<key>UTTypeConformsTo</key>
+			<array>
+				<string>public.data</string>
+				<string>public.content</string>
+			</array>
+			<key>UTTypeDescription</key>
+			<string>NSURLConnectionVCR Cache File</string>
+			<key>UTTypeIdentifier</key>
+			<string>nl.martijnthe.vcr</string>
+			<key>UTTypeTagSpecification</key>
+			<dict>
+				<key>public.filename-extension</key>
+				<array>
+					<string>vcr</string>
+				</array>
+				<key>public.mime-type</key>
+				<array>
+					<string>application/x-plist+vcr</string>
+				</array>
+			</dict>
+		</dict>
+	</array>
 </dict>
 </plist>

NSURLConnectionVCRQuicklook/VCRGetPreview.h

 
 #import <Foundation/Foundation.h>
 
-@interface VCRGetPreview : NSObject
-
-@end
+OSStatus VCRGetPreviewData(NSURL* url,
+                           NSData *__autoreleasing *responseData,
+                           NSURLResponse *__autoreleasing*response,
+                           NSString *__autoreleasing *displayName,
+                           NSString *__autoreleasing *mimeType,
+                           NSString *__autoreleasing *utType,
+                           NSString *__autoreleasing *encoding);

NSURLConnectionVCRQuicklook/VCRGetPreview.m

 //
 
 #import "VCRGetPreview.h"
+#import  "NSURLConnectionVCR.h"
 
-@implementation VCRGetPreview
-
+@interface VCRCache : NSObject <NSCoding>
+@property (nonatomic, readwrite, strong) NSURLResponse* response;
+@property (nonatomic, readwrite, strong) NSData* responseBody;
 @end
+
+OSStatus VCRGetPreviewData(NSURL* url,
+                           NSData *__autoreleasing *responseData,
+                           NSURLResponse *__autoreleasing*response,
+                           NSString *__autoreleasing *displayName,
+                           NSString *__autoreleasing *mimeType,
+                           NSString *__autoreleasing *utType,
+                           NSString *__autoreleasing *encoding)
+{
+    NSData* archiveData = [NSData dataWithContentsOfURL:url];
+    if (archiveData) {
+        VCRCache* cache = [NSKeyedUnarchiver unarchiveObjectWithData:archiveData];
+        
+        if (responseData) {
+            *responseData = cache.responseBody;
+        }
+        
+        if (response) {
+            *response = cache.response;
+        }
+        
+        if (displayName) {
+            NSString* _displayName;
+            if ([cache.response isKindOfClass:[NSHTTPURLResponse class]]) {
+                _displayName = [NSString stringWithFormat:@"%@ [%i]", [[cache.response URL] absoluteString], [(NSHTTPURLResponse*)cache.response statusCode]];
+            } else {
+                _displayName = [[cache.response URL] absoluteString];
+            }
+            *displayName = _displayName;
+        }
+        
+        if (encoding) {
+            NSString* _encoding = [cache.response textEncodingName];
+            if (_encoding == nil) _encoding = @"UTF-8";
+            *encoding = _encoding;
+        }
+        
+        NSString* _mimeType = [cache.response MIMEType];
+        if (_mimeType == nil) _mimeType = @"text/plain";
+        if (mimeType) {
+            *mimeType = _mimeType;
+        }
+        if (utType) {
+            *utType = (__bridge NSString*)UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (__bridge CFStringRef)_mimeType, NULL);
+        }
+        
+        return noErr;
+    } else {
+        return -1;
+    }
+}

NSURLConnectionVCRQuicklook/main.c

 
 // The thumbnail generation function to be implemented in GenerateThumbnailForURL.c
 OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thumbnail, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options, CGSize maxSize);
-void CancelThumbnailGeneration(void* thisInterface, QLThumbnailRequestRef thumbnail);
+//void CancelThumbnailGeneration(void* thisInterface, QLThumbnailRequestRef thumbnail);
 
 // The preview generation function to be implemented in GeneratePreviewForURL.c
 OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, CFURLRef url, CFStringRef contentTypeUTI, CFDictionaryRef options);
-void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview);
+//void CancelPreviewGeneration(void *thisInterface, QLPreviewRequestRef preview);
 
 // The layout for an instance of QuickLookGeneratorPlugIn
 typedef struct __QuickLookGeneratorPluginType
              * return good status.
              */
         ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->GenerateThumbnailForURL = GenerateThumbnailForURL;
-        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelThumbnailGeneration = CancelThumbnailGeneration;
+//        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelThumbnailGeneration = CancelThumbnailGeneration;
         ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->GeneratePreviewForURL = GeneratePreviewForURL;
-        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelPreviewGeneration = CancelPreviewGeneration;
+//        ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType *)thisInstance)->conduitInterface)->CancelPreviewGeneration = CancelPreviewGeneration;
         ((QLGeneratorInterfaceStruct *)((QuickLookGeneratorPluginType*)thisInstance)->conduitInterface)->AddRef(thisInstance);
         *ppv = thisInstance;
         CFRelease(interfaceID);

NSURLConnectionVCRTests/NSURLConnectionVCRTests.m

 //
 
 #import "NSURLConnectionVCRTests.h"
+#import "NSURLConnectionVCR.h"
+#import "HTTPServer.h"
+#import "HTTPConnection.h"
 
-@implementation NSURLConnectionVCRTests
+// The SRCROOT preprocessor variable is set using the "Preprocessor Macros Not Used in Precompiled Headers" (GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS) build setting.
+// This way the caches can be committed together with the tests as part of your project's source, which is makes the tests independent on internet connectivity, if run once and committed.
 
-- (void)setUp
-{
+#define QUOTE(str) #str
+#define EXPAND_AND_QUOTE(str) QUOTE(str)
+
+@interface BreakableHTTPConnection : HTTPConnection
++ (void)setBroken:(BOOL)broken;
+@end
+
+@interface NSURLResponse (Testing)
+- (BOOL)isEqualIgnoringVolatileHTTPHeaders:(NSURLResponse*)otherResponse;
+@end
+
+@interface ConnectionDelegate : NSObject <NSURLConnectionDelegate>
+@property (nonatomic, readonly) NSURLResponse* response;
+@property (nonatomic, readonly) NSData* responseData;
+@property (nonatomic, readonly) NSError* error;
+@property (nonatomic, readonly) BOOL isDone;
+@end
+
+@implementation NSURLConnectionVCRTests {
+    NSString* tapesPath;
+    NSString* docRoot;
+    NSString* testFilename;
+    NSURL* testURL;
+    HTTPServer* httpServer;
+    NSOperationQueue* bgQueue;
+}
+
+- (void)setUp {
     [super setUp];
     
-    // Set-up code here.
+    NSString* srcroot = [NSString stringWithFormat:@"%s", EXPAND_AND_QUOTE(SRCROOT)];
+    tapesPath = [srcroot stringByAppendingPathComponent:@"NSURLConnectionVCRTests/VCRTapes"];
+    
+    // These tests will run against a local server, so they run fast and are not dependent on an external server:
+    httpServer = [[HTTPServer alloc] init];
+    [httpServer setConnectionClass:[BreakableHTTPConnection class]];
+    UInt16 port = 2048;
+    [httpServer setPort:port];
+    docRoot = [srcroot stringByAppendingPathComponent:@"NSURLConnectionVCRTests/htdocs"];
+    [httpServer setDocumentRoot:docRoot];
+    
+    NSError *error = nil;
+    
+    int retries = 0;
+    while ([httpServer start:&error] == NO) {
+        [NSThread sleepForTimeInterval:0.1];
+        ++retries;
+        if (retries > 20) {
+            STFail(@"Error starting HTTP Server: %@", error);
+            break;
+        }
+    }
+    
+    // testURL = [NSURL URLWithString:@"https://raw.github.com/gist/1909468/267a404619b83a3d897b10d9904fd9644f5486d2/NSURLConnectionVCRTest.json"];
+    testFilename = @"TestResponse.json";
+    testURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://localhost:%u/%@", port, testFilename]];
+    
+    bgQueue = [[NSOperationQueue alloc] init];
+    [bgQueue setMaxConcurrentOperationCount:1];
+    
+    [BreakableHTTPConnection setBroken:NO];
+    [NSURLConnectionVCR startVCRWithPath:tapesPath error:nil];
 }
 
-- (void)tearDown
-{
-    // Tear-down code here.
-    
+- (void)tearDown {
     [super tearDown];
+    [NSURLConnectionVCR stopVCRWithError:nil];
+    [httpServer stop];
+}
+
+- (void)testBrokenServer {
+    [NSURLConnectionVCR stopVCRWithError:nil];
+    NSURLRequest* request = [NSURLRequest requestWithURL:testURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30.0];
+    NSHTTPURLResponse* response = nil;
+    [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];
+    STAssertTrue([response statusCode] == 200, @"Expecting 200 status");
+    
+    [BreakableHTTPConnection setBroken:YES];
+    [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];
+    STAssertTrue([response statusCode] == 400, @"Expecting 400 status after breaking the server");
+}
+
+- (void)testStarted {
+    STAssertTrue([NSURLConnectionVCR isVCRStarted], @"VCR expected to be started");
+    id connection = [[NSURLConnection alloc] initWithRequest:[NSURLRequest requestWithURL:testURL] delegate:self];
+    STAssertTrue([connection class] == [NSURLConnectionVCR class], @"[NSURLConnection alloc] is expected to create a NSURLConnectionVCR object.");
 }
 
-- (void)testExample
-{
-    STFail(@"Unit tests are not implemented yet in NSURLConnectionVCRTests");
+- (void)testAlreadyStarted {
+    NSError* error = nil;
+    [NSURLConnectionVCR startVCRWithPath:tapesPath error:&error];
+    STAssertTrue(error && [error code] == NSURLConnectionVCRErrorAlreadyStarted, @"Expecting error, because already started.");
+}
+
+- (void)testAlreadyStopped {
+    NSError* error = nil;
+    BOOL success;
+    success = [NSURLConnectionVCR stopVCRWithError:&error];
+    STAssertTrue(success && error == nil, @"Expecting no errors, because should be able to stop when VCR is started.");
+    success = [NSURLConnectionVCR stopVCRWithError:&error];
+    STAssertTrue(success == NO && error && [error code] == NSURLConnectionVCRErrorAlreadyStopped, @"Expecting error, because already stopped.");
+}
+
+- (void)testSetNonExistingPath {
+    NSError* error = nil;
+    NSString* randomPath;
+    BOOL fileExists;
+    NSFileManager* fm = [NSFileManager defaultManager];
+    do {
+        randomPath = [NSTemporaryDirectory() stringByAppendingPathExtension:[NSString stringWithFormat:@"%i", arc4random()]];
+        fileExists = [fm fileExistsAtPath:randomPath];
+    } while (fileExists == YES);
+    BOOL success = [NSURLConnectionVCR setPath:randomPath error:&error];
+    STAssertTrue(success && error == nil, @"Expecting no errors when setting a non-existing path");
+}
+
+- (void)testSetNilPath {
+    NSError* error = nil;
+    BOOL success = [NSURLConnectionVCR setPath:nil error:&error];
+    STAssertTrue(success && error == nil, @"Expecting no error when setting nil path");
+}
+
+- (void)testSetNonExistingInvalidPath {
+    NSError* error = nil;
+    BOOL success = [NSURLConnectionVCR setPath:@"/:invalid:path" error:&error];
+    STAssertTrue(success == NO && error && [error code] == NSURLConnectionVCRErrorCouldNotCreateDirectory, @"Expecting error when setting an invalid path");
+}
+
+- (void)testStartWithInvalidPath {
+    [NSURLConnectionVCR stopVCRWithError:nil];
+    NSError* error = nil;
+    BOOL success = [NSURLConnectionVCR startVCRWithPath:@"/:invalid:path" error:&error];
+    STAssertTrue(success == NO && error && [error code] == NSURLConnectionVCRErrorCouldNotCreateDirectory, @"Expecting error when setting an invalid path");    
+}
+
+- (void)testSetPathNotADirectory {
+    NSError* error = nil;
+    NSBundle* testBundle = [NSBundle bundleForClass:[self class]];
+    NSString* filePath = [testBundle executablePath];
+    BOOL success = [NSURLConnectionVCR setPath:filePath error:&error];
+    STAssertTrue(success == NO && error && [error code] == NSURLConnectionVCRErrorPathIsNotADirectory, @"Expecting error when setting a path that refers to a file");
+}
+
+- (void)testSynchronousRequest {
+    NSError* error = nil;
+    NSURLRequest* request = [NSURLRequest requestWithURL:testURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30.0];
+    
+    // Do request with no VCR:
+    [NSURLConnectionVCR stopVCRWithError:nil];
+    NSURLResponse* responseNoVCR = nil;
+    NSData* dataNoVCR = [NSURLConnection sendSynchronousRequest:request returningResponse:&responseNoVCR error:&error];
+    if (dataNoVCR == nil || error) {
+        STFail(@"Problem fetching testURL (%@): %@", testURL, error);
+    }
+    
+    // Do request with cold VCR:
+    [NSURLConnectionVCR startVCRWithPath:tapesPath error:&error];
+    if ([NSURLConnectionVCR hasCacheForRequest:request]) {
+        [NSURLConnectionVCR deleteCacheForRequest:request error:nil];
+    }
+    NSURLResponse* responseColdVCR = nil;
+    NSData* dataColdVCR = [NSURLConnection sendSynchronousRequest:request returningResponse:&responseColdVCR error:&error];
+    if (dataColdVCR == nil || error) {
+        STFail(@"Problem fetching testURL with cold VCR (%@): %@", testURL, error);
+    }
+    STAssertTrue([dataColdVCR isEqual:dataNoVCR], @"Response body without VCR is expected to be equal to response body with cold VCR.");
+    STAssertTrue([responseColdVCR isEqualIgnoringVolatileHTTPHeaders:responseNoVCR], @"Response without VCR is expected to be equal to response with cold VCR.");
+
+    // Do request with hot VCR:
+    [BreakableHTTPConnection setBroken:YES];
+    STAssertTrue([NSURLConnectionVCR hasCacheForRequest:request], @"VCR is expected to have a cache for the request by now.");
+    NSURLResponse* responseHotVCR = nil;
+    NSData* dataHotVCR = [NSURLConnection sendSynchronousRequest:request returningResponse:&responseHotVCR error:&error];
+    if (dataHotVCR == nil || error) {
+        STFail(@"Problem fetching testURL with hot VCR (%@): %@", testURL, error);
+    }