summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/util/URIUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/danoeh/antennapod/util/URIUtil.java')
-rw-r--r--src/de/danoeh/antennapod/util/URIUtil.java35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/de/danoeh/antennapod/util/URIUtil.java b/src/de/danoeh/antennapod/util/URIUtil.java
deleted file mode 100644
index 5af40d591..000000000
--- a/src/de/danoeh/antennapod/util/URIUtil.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package de.danoeh.antennapod.util;
-
-import android.util.Log;
-import de.danoeh.antennapod.BuildConfig;
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-/**
- * Utility methods for dealing with URL encoding.
- */
-public class URIUtil {
- private static final String TAG = "URIUtil";
-
- private URIUtil() {}
-
- public static URI getURIFromRequestUrl(String source) {
- // try without encoding the URI
- try {
- return new URI(source);
- } catch (URISyntaxException e) {
- if (BuildConfig.DEBUG) Log.d(TAG, "Source is not encoded, encoding now");
- }
- try {
- URL url = new URL(source);
- return new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef());
- } catch (MalformedURLException e) {
- throw new IllegalArgumentException(e);
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException(e);
- }
- }
-}