Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Christopher Cotton
2011-06-17 12:07:50 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
22f1b31584b843cb2587ee5d0d0783c862bf2a53
22f1b315
1 parent
2980421f
Cache would not store the downloaded data if the cached file already existed. Remove old one first
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
Classes/ASIDownloadCache.m
Classes/ASIDownloadCache.m
View file @
22f1b31
...
...
@@ -183,9 +183,14 @@ static NSString *permanentCacheFolder = @"PermanentStore";
if
([
request
responseData
])
{
[[
request
responseData
]
writeToFile
:
dataPath
atomically
:
NO
];
}
else
if
([
request
downloadDestinationPath
]
&&
!
[[
request
downloadDestinationPath
]
isEqualToString
:
dataPath
])
{
}
else
if
([
request
downloadDestinationPath
]
&&
!
[[
request
downloadDestinationPath
]
isEqualToString
:
dataPath
])
{
NSError
*
error
=
nil
;
[[[[
NSFileManager
alloc
]
init
]
autorelease
]
copyItemAtPath
:[
request
downloadDestinationPath
]
toPath
:
dataPath
error
:&
error
];
NSFileManager
*
manager
=
[[
NSFileManager
alloc
]
init
];
if
([
manager
fileExistsAtPath
:
dataPath
])
{
[
manager
removeItemAtPath
:
dataPath
error
:
&
error
];
}
[
manager
copyItemAtPath
:[
request
downloadDestinationPath
]
toPath
:
dataPath
error
:&
error
];
[
manager
release
];
}
[[
self
accessLock
]
unlock
];
}
...
...
Please
register
or
login
to post a comment