Use new log system
This commit is contained in:
@ -51,7 +51,7 @@ public class CheckHttpResponse extends AsyncTask<String, Void, Boolean> {
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Log.w(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -35,16 +35,12 @@ public class DownloadTile extends AsyncTask<String, Void, Boolean> {
|
||||
Log.d("writing to file: " + file.toString());
|
||||
writeTileToFile(is, file);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void writeTileToFile(InputStream inStream, File file) throws Exception {
|
||||
private void writeTileToFile(InputStream inStream, File file) throws IOException {
|
||||
file.getParentFile().mkdirs();
|
||||
FileOutputStream outStream = new FileOutputStream(file);
|
||||
int bufferSize = 1024;
|
||||
@ -53,7 +49,7 @@ public class DownloadTile extends AsyncTask<String, Void, Boolean> {
|
||||
while ((len = inStream.read(buffer)) != -1) {
|
||||
outStream.write(buffer, 0, len);
|
||||
}
|
||||
if(outStream!=null) outStream.close();
|
||||
if (outStream != null)
|
||||
outStream.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package com.cradle.iitc_mobile.async;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import com.cradle.iitc_mobile.Log;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Scanner;
|
||||
@ -21,7 +23,7 @@ public class UrlContentToString extends AsyncTask<URL, Integer, String> {
|
||||
js = new Scanner(url.openStream(), "UTF-8").useDelimiter("\\A")
|
||||
.next();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Log.w(e);
|
||||
}
|
||||
return js;
|
||||
}
|
||||
|
Reference in New Issue
Block a user