File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ extension DiskStorage: StorageAware {
6464
6565 public func entry( forKey key: Key ) throws -> Entry < Value > {
6666 let filePath = makeFilePath ( for: key)
67- let data = try Data ( contentsOf: URL ( fileURLWithPath: filePath) )
67+ let data = try Data ( contentsOf: URL ( fileURLWithPath: filePath, isDirectory : false ) )
6868 let attributes = try fileManager. attributesOfItem ( atPath: filePath)
6969 let object = try transformer. fromData ( data)
7070
@@ -99,7 +99,7 @@ extension DiskStorage: StorageAware {
9999 }
100100
101101 public func removeExpiredObjects( ) throws {
102- let storageURL = URL ( fileURLWithPath: path)
102+ let storageURL = URL ( fileURLWithPath: path, isDirectory : true )
103103 let resourceKeys : [ URLResourceKey ] = [
104104 . isDirectoryKey,
105105 . contentModificationDateKey,
@@ -167,7 +167,7 @@ extension DiskStorage {
167167 */
168168 func makeFileName( for key: Key ) -> String {
169169 if let key = key as? String {
170- let fileExtension = URL ( fileURLWithPath : key) . pathExtension
170+ let fileExtension = ( key as NSString ) . pathExtension
171171 let fileName = MD5 ( key)
172172
173173 switch fileExtension. isEmpty {
You can’t perform that action at this time.
0 commit comments