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

Unified Diff: src/org/adblockplus/brazil/BaseRequestHandler.java

Issue 8484110: ABP/Android proxy service (Closed)
Patch Set: ABP/Android proxy service Created Nov. 12, 2012, 8:53 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
« no previous file with comments | « src/org/adblockplus/android/ProxySettings.java ('k') | src/org/adblockplus/brazil/RequestHandler.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/org/adblockplus/brazil/BaseRequestHandler.java
===================================================================
new file mode 100644
--- /dev/null
+++ b/src/org/adblockplus/brazil/BaseRequestHandler.java
@@ -0,0 +1,43 @@
+package org.adblockplus.brazil;
+
+import java.util.Properties;
+
+import sunlabs.brazil.server.Handler;
+import sunlabs.brazil.server.Server;
+
+public abstract class BaseRequestHandler implements Handler
+{
+
+ public static final String PROXY_HOST = "proxyHost";
+ public static final String PROXY_PORT = "proxyPort";
+ public static final String AUTH = "auth";
+ protected String proxyHost;
+ protected int proxyPort = 80;
+ protected String auth;
+
+ protected String prefix;
+
+ @Override
+ public boolean init(Server server, String prefix)
+ {
+ this.prefix = prefix;
Felix Dahlke 2012/11/13 07:40:35 Indentation is off here.
+
+ Properties props = server.props;
+
+ proxyHost = props.getProperty(prefix + PROXY_HOST);
+
+ String s = props.getProperty(prefix + PROXY_PORT);
+ try
+ {
+ proxyPort = Integer.decode(s).intValue();
+ }
+ catch (Exception e)
+ {
+ }
+
+ auth = props.getProperty(prefix + AUTH);
+
+ return true;
+ }
+
+}
« no previous file with comments | « src/org/adblockplus/android/ProxySettings.java ('k') | src/org/adblockplus/brazil/RequestHandler.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld