mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-14 14:30:10 +00:00
choose complicated approach for encoding URLs, as tycho doesn't allow com.google.gwt references in common bundles
This commit is contained in:
1 parent
523ad4cc3e
commit
52fa52efce
9 files changed
+69
-43
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package com.sap.sse.util.impl;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
|
||||
import com.sap.sse.common.util.UrlHelper;
|
||||
|
||||
public enum NonGwtUrlHelper implements UrlHelper {
|
||||
INSTANCE;
|
||||
|
||||
public String encodeUrl(String decodedUrlString) {
|
||||
try {
|
||||
URL url = new URL(decodedUrlString);
|
||||
URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(),
|
||||
url.getQuery(), url.getRef());
|
||||
return uri.toString();
|
||||
} catch (MalformedURLException | URISyntaxException f) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user