Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 { | 213 { |
214 final String id = sub.getId(); | 214 final String id = sub.getId(); |
215 if (!this.subscriptions.containsKey(id)) | 215 if (!this.subscriptions.containsKey(id)) |
216 { | 216 { |
217 this.subscriptions.put(id, sub); | 217 this.subscriptions.put(id, sub); |
218 return sub; | 218 return sub; |
219 } | 219 } |
220 return this.subscriptions.get(id); | 220 return this.subscriptions.get(id); |
221 } | 221 } |
222 | 222 |
223 public boolean remove(final String id) | |
224 { | |
225 if (this.subscriptions.containsKey(id)) | |
anton
2017/08/25 10:40:40
the whole method could be replaced with `return th
jens
2017/08/25 11:35:07
Acknowledged.
The return values is not needed yet
| |
226 { | |
227 this.subscriptions.remove(id); | |
228 return true; | |
229 } | |
230 return false; | |
231 } | |
232 | |
223 public static Subscriptions initialize(final Engine engine, final File appFold er, | 233 public static Subscriptions initialize(final Engine engine, final File appFold er, |
224 final File cacheFolder) | 234 final File cacheFolder) |
225 { | 235 { |
226 final Subscriptions subs = new Subscriptions(engine, appFolder, cacheFolder) ; | 236 final Subscriptions subs = new Subscriptions(engine, appFolder, cacheFolder) ; |
227 | 237 |
228 subs.subscriptionFolder.mkdirs(); | 238 subs.subscriptionFolder.mkdirs(); |
229 subs.cacheFolder.mkdirs(); | 239 subs.cacheFolder.mkdirs(); |
230 | 240 |
231 final File[] files = subs.subscriptionFolder.listFiles(); | 241 final File[] files = subs.subscriptionFolder.listFiles(); |
232 for (File f : files) | 242 for (File f : files) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 if (sub != null) | 294 if (sub != null) |
285 { | 295 { |
286 if (sub.updateSubscription(responseCode, text, httpHeaders, this.getMetaFi le(sub), | 296 if (sub.updateSubscription(responseCode, text, httpHeaders, this.getMetaFi le(sub), |
287 this.getFiltersFile(sub))) | 297 this.getFiltersFile(sub))) |
288 { | 298 { |
289 this.engine.requestUpdateBroadcast(); | 299 this.engine.requestUpdateBroadcast(); |
290 } | 300 } |
291 } | 301 } |
292 } | 302 } |
293 } | 303 } |
OLD | NEW |