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 return this.subscriptions.remove(id) != null; |
| 226 } |
| 227 |
223 public static Subscriptions initialize(final Engine engine, final File appFold
er, | 228 public static Subscriptions initialize(final Engine engine, final File appFold
er, |
224 final File cacheFolder) | 229 final File cacheFolder) |
225 { | 230 { |
226 final Subscriptions subs = new Subscriptions(engine, appFolder, cacheFolder)
; | 231 final Subscriptions subs = new Subscriptions(engine, appFolder, cacheFolder)
; |
227 | 232 |
228 subs.subscriptionFolder.mkdirs(); | 233 subs.subscriptionFolder.mkdirs(); |
229 subs.cacheFolder.mkdirs(); | 234 subs.cacheFolder.mkdirs(); |
230 | 235 |
231 final File[] files = subs.subscriptionFolder.listFiles(); | 236 final File[] files = subs.subscriptionFolder.listFiles(); |
232 for (File f : files) | 237 for (File f : files) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 if (sub != null) | 289 if (sub != null) |
285 { | 290 { |
286 if (sub.updateSubscription(responseCode, text, httpHeaders, this.getMetaFi
le(sub), | 291 if (sub.updateSubscription(responseCode, text, httpHeaders, this.getMetaFi
le(sub), |
287 this.getFiltersFile(sub))) | 292 this.getFiltersFile(sub))) |
288 { | 293 { |
289 this.engine.requestUpdateBroadcast(); | 294 this.engine.requestUpdateBroadcast(); |
290 } | 295 } |
291 } | 296 } |
292 } | 297 } |
293 } | 298 } |
OLD | NEW |