*err=[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASICompressionErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"Compression of %@ failed because we were to create a file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,nil]];
}
return;
returnNO;
}
// Ensure the source file exists
...
...
@@ -146,7 +148,7 @@
if(err){
*err=[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASICompressionErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"Compression of %@ failed the file does not exist",sourcePath],NSLocalizedDescriptionKey,nil]];
}
return;
returnNO;
}
UInt8inputData[DATA_CHUNK_SIZE];
...
...
@@ -173,7 +175,7 @@
if(err){
*err=[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASICompressionErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"Compression of %@ failed because we were unable to read from the source data file",sourcePath],NSLocalizedDescriptionKey,[inputStreamstreamError],NSUnderlyingErrorKey,nil]];
}
return;
returnNO;
}
// Attempt to inflate the chunk of data
...
...
@@ -182,7 +184,7 @@
if(err){
*err=theError;
}
return;
returnNO;
}
// Write the deflated data out to the destination file
...
...
@@ -194,13 +196,14 @@
if(err){
*err=[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASICompressionErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"Compression of %@ failed because we were unable to write to the destination data file at &@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStreamstreamError],NSUnderlyingErrorKey,nil]];
*err=[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASICompressionErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"Decompression of %@ failed because we were to create a file at %@",sourcePath,destinationPath],NSLocalizedDescriptionKey,nil]];
}
return;
returnNO;
}
// Ensure the source file exists
...
...
@@ -144,7 +146,7 @@
if(err){
*err=[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASICompressionErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"Decompression of %@ failed the file does not exist",sourcePath],NSLocalizedDescriptionKey,nil]];
}
return;
returnNO;
}
UInt8inputData[DATA_CHUNK_SIZE];
...
...
@@ -171,7 +173,7 @@
if(err){
*err=[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASICompressionErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"Decompression of %@ failed because we were unable to read from the source data file",sourcePath],NSLocalizedDescriptionKey,[inputStreamstreamError],NSUnderlyingErrorKey,nil]];
}
return;
returnNO;
}
// Attempt to inflate the chunk of data
...
...
@@ -180,7 +182,7 @@
if(err){
*err=theError;
}
return;
returnNO;
}
// Write the inflated data out to the destination file
...
...
@@ -192,13 +194,14 @@
if(err){
*err=[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASICompressionErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"Decompression of %@ failed because we were unable to write to the destination data file at &@",sourcePath,destinationPath],NSLocalizedDescriptionKey,[outputStreamstreamError],NSUnderlyingErrorKey,nil]];
*err=[NSErrorerrorWithDomain:NetworkRequestErrorDomaincode:ASIFileManagementErroruserInfo:[NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"Failed to delete file at path '%@'",path],NSLocalizedDescriptionKey,removeError,NSUnderlyingErrorKey,nil]];