All Downloads are FREE. Search and download functionalities are using the official Maven repository.

devutility.internal.net.UrlCoderUtils Maven / Gradle / Ivy

There is a newer version: 1.3.8.1
Show newest version
package devutility.internal.net;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class UrlCoderUtils {
	/**
	 * Encode url string
	 * @param value: Url string
	 * @return String
	 */
	public static String encode(String value) {
		try {
			return URLEncoder.encode(value, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
			return null;
		}
	}

	/**
	 * Decode url string
	 * @param value: Url string
	 * @return String
	 */
	public static String decode(String value) {
		try {
			return URLDecoder.decode(value, "UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
			return null;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy