mirror of
https://github.com/mihonapp/mihon.git
synced 2024-10-31 21:20:59 -04:00
22 lines
531 B
Java
22 lines
531 B
Java
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|