2016-01-15 15:18:19 +01:00
|
|
|
package eu.kanade.tachiyomi.util;
|
2015-11-30 13:07:57 +01:00
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|