Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: libadblockplus-android/src/org/adblockplus/libadblockplus/FileSystem.java

Issue 29424615: Issue 4231 - Fix unstable FilterEngineTest.testSetRemoveFilterChangeCallback (Closed)
Left Patch Set: fixed typo Created April 28, 2017, 8:46 a.m.
Right Patch Set: changed impl for reading file as bytes array, modified test. AndroidFileSystem now does not resolve… Created May 29, 2017, 11:26 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return lastModified; 64 return lastModified;
65 } 65 }
66 66
67 public StatResult(boolean exists, boolean isDirectory, boolean isFile, long lastModified) 67 public StatResult(boolean exists, boolean isDirectory, boolean isFile, long lastModified)
68 { 68 {
69 this.exists = exists; 69 this.exists = exists;
70 this.isDirectory = isDirectory; 70 this.isDirectory = isDirectory;
71 this.isFile = isFile; 71 this.isFile = isFile;
72 this.lastModified = lastModified; 72 this.lastModified = lastModified;
73 } 73 }
74
75 @Override
76 public String toString()
77 {
78 return "StatResult{" +
79 "exists=" + exists +
80 ", isDirectory=" + isDirectory +
81 ", isFile=" + isFile +
82 ", lastModified=" + lastModified +
83 '}';
84 }
74 } 85 }
75 86
76 /** 87 /**
77 * Reads from a file. 88 * Reads from a file.
78 * @param path File path. 89 * @param path File path.
79 * @return File's content as string 90 * @return File's binary data.
80 */ 91 */
81 public abstract String read(String path); 92 public abstract byte[] read(String path);
82 93
83 /** 94 /**
84 * Writes to a file. 95 * Writes to a file.
85 * @param path File path. 96 * @param path File path.
86 * @param data File data to write. 97 * @param data File's binary data to write.
87 */ 98 */
88 public abstract void write(String path, String data); 99 public abstract void write(String path, byte[] data);
89 100
90 /** 101 /**
91 * Moves a file (i.e.\ renames it). 102 * Moves a file (i.e.\ renames it).
92 * @param fromPath Current path to the file. 103 * @param fromPath Current path to the file.
93 * @param toPath New path to the file. 104 * @param toPath New path to the file.
94 */ 105 */
95 public abstract void move(String fromPath, String toPath); 106 public abstract void move(String fromPath, String toPath);
96 107
97 /** 108 /**
98 * Removes a file. 109 * Removes a file.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 dtor(this.ptr); 146 dtor(this.ptr);
136 } 147 }
137 } 148 }
138 149
139 private final static native void registerNatives(); 150 private final static native void registerNatives();
140 151
141 private final static native long ctor(Object callbackObject); 152 private final static native long ctor(Object callbackObject);
142 153
143 private final static native void dtor(long ptr); 154 private final static native void dtor(long ptr);
144 } 155 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld