LEFT | RIGHT |
(no file at all) | |
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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 } | 382 } |
383 | 383 |
384 private static String createFilterHash(List<String> filters) throws IOExceptio
n | 384 private static String createFilterHash(List<String> filters) throws IOExceptio
n |
385 { | 385 { |
386 try | 386 try |
387 { | 387 { |
388 final MessageDigest md5 = MessageDigest.getInstance("MD5"); | 388 final MessageDigest md5 = MessageDigest.getInstance("MD5"); |
389 Collections.sort(filters); | 389 Collections.sort(filters); |
390 for (final String filter : filters) | 390 for (final String filter : filters) |
391 { | 391 { |
392 md5.update(filter.getBytes("UTF-8")); | 392 md5.update(filter.getBytes(Engine.CHARSET_UTF_8)); |
393 } | 393 } |
394 return byteArrayToHexString(md5.digest()); | 394 return byteArrayToHexString(md5.digest()); |
395 } | 395 } |
396 catch (final NoSuchAlgorithmException e) | 396 catch (final NoSuchAlgorithmException e) |
397 { | 397 { |
398 throw new IOException("MD5 is unavailable: " + e.getMessage(), e); | 398 throw new IOException("MD5 is unavailable: " + e.getMessage(), e); |
399 } | 399 } |
400 } | 400 } |
401 | 401 |
402 public void serializeMetaData(final File metaFile) throws IOException | 402 public void serializeMetaData(final File metaFile) throws IOException |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 this.serializeMetaData(metaFile); | 630 this.serializeMetaData(metaFile); |
631 if (filtersChanged) | 631 if (filtersChanged) |
632 { | 632 { |
633 this.serializeFilters(filtersFile); | 633 this.serializeFilters(filtersFile); |
634 this.clearFilters(); | 634 this.clearFilters(); |
635 } | 635 } |
636 | 636 |
637 return filtersChanged; | 637 return filtersChanged; |
638 } | 638 } |
639 } | 639 } |
LEFT | RIGHT |