9
9
import java .util .zip .ZipEntry ;
10
10
import java .util .zip .ZipInputStream ;
11
11
12
-
13
12
import android .net .Uri ;
14
13
import org .apache .cordova .CallbackContext ;
15
14
import org .apache .cordova .CordovaPlugin ;
16
15
import org .apache .cordova .CordovaResourceApi .OpenForReadResult ;
16
+ import org .apache .cordova .LOG ;
17
17
import org .apache .cordova .PluginResult ;
18
18
import org .json .JSONException ;
19
19
import org .json .JSONObject ;
20
20
21
- import android .util .Log ;
22
-
23
21
public class Zip extends CordovaPlugin {
24
22
25
23
private static final String LOG_TAG = "Zip" ;
@@ -67,7 +65,7 @@ private void unzipSync(CordovaArgs args, CallbackContext callbackContext) {
67
65
if (tempFile == null || !tempFile .exists ()) {
68
66
String errorMessage = "Zip file does not exist" ;
69
67
callbackContext .error (errorMessage );
70
- Log .e (LOG_TAG , errorMessage );
68
+ LOG .e (LOG_TAG , errorMessage );
71
69
return ;
72
70
}
73
71
@@ -77,7 +75,7 @@ private void unzipSync(CordovaArgs args, CallbackContext callbackContext) {
77
75
if (outputDir == null || (!outputDir .exists () && !outputDir .mkdirs ())){
78
76
String errorMessage = "Could not create output directory" ;
79
77
callbackContext .error (errorMessage );
80
- Log .e (LOG_TAG , errorMessage );
78
+ LOG .e (LOG_TAG , errorMessage );
81
79
return ;
82
80
}
83
81
@@ -128,7 +126,7 @@ private void unzipSync(CordovaArgs args, CallbackContext callbackContext) {
128
126
File file = new File (outputDirectory + compressedName );
129
127
file .getParentFile ().mkdirs ();
130
128
if (file .exists () || file .createNewFile ()){
131
- Log .w ("Zip" , "extracting: " + file .getPath ());
129
+ LOG .w (LOG_TAG , "extracting: " + file .getPath ());
132
130
FileOutputStream fout = new FileOutputStream (file );
133
131
int count ;
134
132
while ((count = zis .read (buffer )) != -1 )
@@ -155,7 +153,7 @@ private void unzipSync(CordovaArgs args, CallbackContext callbackContext) {
155
153
} catch (Exception e ) {
156
154
String errorMessage = "An error occurred while unzipping." ;
157
155
callbackContext .error (errorMessage );
158
- Log .e (LOG_TAG , errorMessage , e );
156
+ LOG .e (LOG_TAG , errorMessage , e );
159
157
} finally {
160
158
if (inputStream != null ) {
161
159
try {
0 commit comments