mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 00:37:59 -06:00
Add some comments
This commit is contained in:
@@ -5,6 +5,7 @@ import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
// Class to download remote file.
|
||||
public class HttpGetFile extends AsyncTask<Void, Integer, File> {
|
||||
|
||||
public interface DownloadCallback {
|
||||
@@ -136,8 +137,7 @@ public class HttpGetFile extends AsyncTask<Void, Integer, File> {
|
||||
return response.toString();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
AlertManager.error(e);
|
||||
// Log.e(TAG, "Error reading error response", e);
|
||||
AlertManager.error("Error reading error response", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -145,9 +145,9 @@ public class HttpGetFile extends AsyncTask<Void, Integer, File> {
|
||||
private void deletePartialFile() {
|
||||
if (destinationFile != null && destinationFile.exists()) {
|
||||
if (destinationFile.delete()) {
|
||||
// Log.d(TAG, "Partial download file deleted");
|
||||
AlertManager.error("Partial download file deleted");
|
||||
} else {
|
||||
// Log.w(TAG, "Failed to delete partial download file");
|
||||
AlertManager.error("Failed to delete partial download file");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,15 +156,13 @@ public class HttpGetFile extends AsyncTask<Void, Integer, File> {
|
||||
try {
|
||||
if (inputStream != null) inputStream.close();
|
||||
} catch (IOException e) {
|
||||
AlertManager.error(e);
|
||||
// Log.e(TAG, "Error closing input stream", e);
|
||||
AlertManager.error("Error closing input stream", e);
|
||||
}
|
||||
|
||||
try {
|
||||
if (outputStream != null) outputStream.close();
|
||||
} catch (IOException e) {
|
||||
AlertManager.error(e);
|
||||
// Log.e(TAG, "Error closing output stream", e);
|
||||
AlertManager.error("Error closing output stream", e);
|
||||
}
|
||||
|
||||
if (connection != null) {
|
||||
|
||||
Reference in New Issue
Block a user