Add some comments

This commit is contained in:
Michael Mikovsky
2025-09-21 12:53:59 -06:00
parent 93b58310bf
commit fa47eb1aff
4 changed files with 35 additions and 22 deletions
@@ -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) {