LEFT | RIGHT |
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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 24 matching lines...) Expand all Loading... |
35 { | 35 { |
36 return patternsIniExists; | 36 return patternsIniExists; |
37 } | 37 } |
38 | 38 |
39 public void setPatternsIniExists(boolean patternsIniExists) | 39 public void setPatternsIniExists(boolean patternsIniExists) |
40 { | 40 { |
41 this.patternsIniExists = patternsIniExists; | 41 this.patternsIniExists = patternsIniExists; |
42 } | 42 } |
43 | 43 |
44 @Override | 44 @Override |
45 public String read(String path) | 45 public byte[] read(String path) |
46 { | 46 { |
| 47 String result; |
47 if (path.equals(PATTERNS_INI)) | 48 if (path.equals(PATTERNS_INI)) |
48 { | 49 { |
49 return "# Adblock Plus preferences\n[Subscription]\nurl=~fl~"; | 50 result = "# Adblock Plus preferences\n[Subscription]\nurl=~fl~"; |
50 } | 51 } |
51 else if (path.equals("prefs.json")) | 52 else if (path.equals("prefs.json")) |
52 { | 53 { |
53 return "{}"; | 54 result = "{}"; |
54 } | 55 } |
55 else | 56 else |
56 { | 57 { |
57 return ""; | 58 result = ""; |
58 } | 59 } |
| 60 return result.getBytes(); |
59 } | 61 } |
60 | 62 |
61 @Override | 63 @Override |
62 public void write(String path, String data) | 64 public void write(String path, byte[] data) |
63 { | 65 { |
64 | 66 |
65 } | 67 } |
66 | 68 |
67 @Override | 69 @Override |
68 public void move(String fromPath, String toPath) | 70 public void move(String fromPath, String toPath) |
69 { | 71 { |
70 | 72 |
71 } | 73 } |
72 | 74 |
(...skipping 23 matching lines...) Expand all Loading... |
96 { | 98 { |
97 super.setUp(); | 99 super.setUp(); |
98 | 100 |
99 jsEngine.setWebRequest(new LazyWebRequest()); | 101 jsEngine.setWebRequest(new LazyWebRequest()); |
100 jsEngine.setDefaultLogSystem(); | 102 jsEngine.setDefaultLogSystem(); |
101 jsEngine.setFileSystem(new PatternsIniStubFileSystem()); | 103 jsEngine.setFileSystem(new PatternsIniStubFileSystem()); |
102 | 104 |
103 filterEngine = new FilterEngine(jsEngine); | 105 filterEngine = new FilterEngine(jsEngine); |
104 } | 106 } |
105 } | 107 } |
LEFT | RIGHT |