1
1
import { Observable } from "tns-core-modules/data/observable" ;
2
2
import * as common from "./index" ;
3
3
import * as fileSystemModule from "tns-core-modules/file-system" ;
4
- import * as utils from "tns-core-modules/utils/utils" ;
5
4
6
5
const main_queue = dispatch_get_current_queue ( ) ;
7
6
let zonedOnProgress = null ;
@@ -22,8 +21,7 @@ function onProgress(nsSession, nsTask, sent, expectedTotal) {
22
21
function onError ( session , nsTask , error ) {
23
22
const task = Task . getTask ( session , nsTask ) ;
24
23
if ( task . _fileToCleanup ) {
25
- const fileManager = utils . ios . getter ( NSFileManager , NSFileManager . defaultManager ) ;
26
- fileManager . removeItemAtPathError ( task . _fileToCleanup ) ;
24
+ NSFileManager . defaultManager . removeItemAtPathError ( task . _fileToCleanup ) ;
27
25
}
28
26
const response = nsTask && < NSHTTPURLResponse > nsTask . performSelector ( "response" ) ;
29
27
if ( error ) {
@@ -401,9 +399,7 @@ class MultiMultiPartForm {
401
399
newData = tempString . dataUsingEncoding ( NSUTF8StringEncoding ) ;
402
400
combinedData . appendData ( newData ) ;
403
401
404
-
405
- const fileManager = utils . ios . getter ( NSFileManager , NSFileManager . defaultManager ) ;
406
- fileManager . createFileAtPathContentsAttributes ( fileName , combinedData , null ) ;
402
+ NSFileManager . defaultManager . createFileAtPathContentsAttributes ( fileName , combinedData , null ) ;
407
403
408
404
return fileName ;
409
405
}
0 commit comments