Skip to content

Commit

Permalink
ios: Fix unzip when given a file: URL
Browse files Browse the repository at this point in the history
  • Loading branch information
agrieve committed May 1, 2014
1 parent 65cc5d8 commit 82597cc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ios/Zip.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ - (NSString *)pathForURL:(NSString *)urlString
{
// Attempt to use the File plugin to resolve the destination argument to a
// file path.
NSString *path;
NSString *path = nil;
id filePlugin = [self.commandDelegate getCommandInstance:@"File"];
if (filePlugin != nil) {
CDVFilesystemURL* url = [CDVFilesystemURL fileSystemURLWithString:urlString];
path = [filePlugin filesystemPathForURL:url];
}
// If that didn't work for any reason, return the original argument.
// If that didn't work for any reason, assume file: URL.
if (path == nil) {
path = urlString;
if ([urlString hasPrefix:@"file:"]) {
path = [[NSURL URLWithString:urlString] path];
}
}
return path;
}
Expand Down

0 comments on commit 82597cc

Please sign in to comment.