diff --git a/app/src/main/java/org/transdroid/daemon/Aria2c/Aria2Adapter.java b/app/src/main/java/org/transdroid/daemon/Aria2c/Aria2Adapter.java index b2e62534..1e02ef9e 100644 --- a/app/src/main/java/org/transdroid/daemon/Aria2c/Aria2Adapter.java +++ b/app/src/main/java/org/transdroid/daemon/Aria2c/Aria2Adapter.java @@ -106,7 +106,7 @@ public class Aria2Adapter implements IDaemonAdapter { buildRequest("aria2.tellStopped", new JSONArray().put(0).put(9999).put(fields)); params.put(active).put(waiting).put(stopped); - List torrents = new ArrayList(); + List torrents = new ArrayList<>(); JSONArray lists = makeRequestForArray(log, params.toString()); for (int i = 0; i < lists.length(); i++) { torrents.addAll(parseJsonRetrieveTorrents(lists.getJSONObject(i).getJSONArray("result"))); @@ -322,10 +322,10 @@ public class Aria2Adapter implements IDaemonAdapter { } - private ArrayList parseJsonRetrieveTorrents(JSONArray response) throws JSONException, DaemonException { + private ArrayList parseJsonRetrieveTorrents(JSONArray response) throws JSONException { // Parse response - ArrayList torrents = new ArrayList(); + ArrayList torrents = new ArrayList<>(); for (int j = 0; j < response.length(); j++) { // Add the parsed torrent to the list @@ -392,7 +392,7 @@ public class Aria2Adapter implements IDaemonAdapter { private ArrayList parseJsonFileListing(JSONArray response, Torrent torrent) throws JSONException { // Parse response - ArrayList files = new ArrayList(); + ArrayList files = new ArrayList<>(); for (int j = 0; j < response.length(); j++) { JSONObject file = response.getJSONObject(j); @@ -420,8 +420,8 @@ public class Aria2Adapter implements IDaemonAdapter { private TorrentDetails parseJsonTorrentDetails(JSONObject response) throws JSONException { // Parse response - List trackers = new ArrayList(); - List errors = new ArrayList(); + List trackers = new ArrayList<>(); + List errors = new ArrayList<>(); int error = response.optInt("errorCode", 0); if (error > 0) { diff --git a/app/src/main/java/org/transdroid/daemon/Daemon.java b/app/src/main/java/org/transdroid/daemon/Daemon.java index 5dd97bcf..70e538bc 100644 --- a/app/src/main/java/org/transdroid/daemon/Daemon.java +++ b/app/src/main/java/org/transdroid/daemon/Daemon.java @@ -333,7 +333,7 @@ public enum Daemon { } public static boolean supportsCustomFolder(Daemon type) { - return type == rTorrent || type == Tfb4rt || type == Bitflu || type == Deluge || type == DelugeRpc + return type == rTorrent || type == Tfb4rt || type == Bitflu || type == Deluge || type == DelugeRpc || type == Aria2 || type == Transmission || type == BitTorrent || type == uTorrent || type == qBittorrent || type == Dummy; } diff --git a/app/src/main/java/org/transdroid/daemon/DaemonSettings.java b/app/src/main/java/org/transdroid/daemon/DaemonSettings.java index 52218b7d..c02bc34f 100644 --- a/app/src/main/java/org/transdroid/daemon/DaemonSettings.java +++ b/app/src/main/java/org/transdroid/daemon/DaemonSettings.java @@ -122,7 +122,7 @@ public final class DaemonSettings { return sslTrustKey; } public String getFolder() { - return folder == null? null: (folder.startsWith("/")? folder: folder + "/"); + return folder == null ? null : (folder.startsWith("/") ? folder : folder + "/"); } public boolean shouldUseAuthentication() { return useAuthentication;