com.sinch.sdk.core.http.URLPathUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sinch-sdk-java Show documentation
Show all versions of sinch-sdk-java Show documentation
SDK providing a Java API for the Sinch REST APIs.
package com.sinch.sdk.core.http;
import com.sinch.sdk.core.utils.StringUtil;
import java.net.URI;
import java.net.URISyntaxException;
public class URLPathUtils {
public static String encodePathSegment(String segment) {
if (StringUtil.isEmpty(segment)) {
return "";
}
URI uri;
try {
uri = new URI("foo", "foo", "/" + segment, null);
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
return uri.getRawPath().substring(1);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy