Don't store sources domain in database

This commit is contained in:
inorichi
2015-11-30 13:07:57 +01:00
parent a05cc934d0
commit 8bda39ee26
9 changed files with 140 additions and 112 deletions

View File

@@ -0,0 +1,21 @@
package eu.kanade.mangafeed.util;
import java.net.URI;
import java.net.URISyntaxException;
public class UrlUtil {
public static String getPath(String s) {
try {
URI uri = new URI(s);
String out = uri.getPath();
if (uri.getQuery() != null)
out += "?" + uri.getQuery();
if (uri.getFragment() != null)
out += "#" + uri.getFragment();
return out;
} catch (URISyntaxException e) {
return s;
}
}
}