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

Unified Diff: src/org/adblockplus/android/AdblockPlus.java

Issue 9433002: ABP/Android Proxy settings user helper (Closed)
Patch Set: Created Feb. 20, 2013, 8:49 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/org/adblockplus/android/AdblockPlus.java
===================================================================
--- a/src/org/adblockplus/android/AdblockPlus.java
+++ b/src/org/adblockplus/android/AdblockPlus.java
@@ -23,6 +23,7 @@
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
@@ -135,6 +136,23 @@
return capitalize(manufacturer) + " " + model;
}
+ public static void appendRawTextFile(Context context, StringBuilder text, int id)
+ {
+ InputStream inputStream = context.getResources().openRawResource(id);
+ InputStreamReader in = new InputStreamReader(inputStream);
+ BufferedReader buf = new BufferedReader(in);
+ String line;
+ try
+ {
+ while ((line = buf.readLine()) != null)
+ text.append(line);
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
private static String capitalize(String s)
{
if (s == null || s.length() == 0)

Powered by Google App Engine
This is Rietveld