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

Unified Diff: libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java

Issue 29411633: Issue 5136 - Add test for AndroidWebRequestResourceWrapper (Closed)
Patch Set: added "static final" for the test impls Created April 28, 2017, 6:09 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 | « libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequestResourceWrapper.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
index 93611101a97382b42a3dc8f75e682bc741c5a103..79c5a8692c40a6fda04d6e9c7d88b7034c846ec2 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
@@ -136,4 +136,14 @@ public final class Utils
}
}
}
+
+ public static String getUrlWithoutParams(String urlWithParams)
+ {
+ if (urlWithParams == null) {
Felix Dahlke 2017/05/09 08:10:49 Nit: Opening brace should go on its own line.
anton 2017/05/10 07:46:53 Acknowledged.
+ throw new IllegalArgumentException("URL can't be null");
+ }
+
+ int pos = urlWithParams.indexOf("?");
+ return (pos >= 0 ? urlWithParams.substring(0, pos) : urlWithParams);
+ }
}
« no previous file with comments | « libadblockplus-android/src/org/adblockplus/libadblockplus/android/AndroidWebRequestResourceWrapper.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld