Here you can find the source of encodeSpecialMdxCharactersInNames(String name)
Parameter | Description |
---|---|
name | a parameter |
public static String encodeSpecialMdxCharactersInNames(String name)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class Main { /**//from ww w . ja v a2 s .c o m * We need to make sure that names of multidimensional elements do not carry * any MDX special characters. * * Note: You can use a bash command for translating a URI into an MDX * applicable form: * * echo "http://lod.gesis.org/lodpilot/ALLBUS/geo.rdf#list" | sed * 's/\./YYY/g' | sed 's/-/ZZZ/g' | sed 's/%/XXX/g' * * @param name * @return */ public static String encodeSpecialMdxCharactersInNames(String name) { try { name = URLEncoder.encode(name, "UTF-8"); name = name.replace("%", "XXX"); name = name.replace(".", "YYY"); name = name.replace("-", "ZZZ"); return name; } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } }