2121import java .nio .charset .Charset ;
2222import java .util .ArrayList ;
2323import java .util .Locale ;
24- import java .util .regex .Pattern ;
2524
2625import org .apache .wicket .WicketRuntimeException ;
2726import org .apache .wicket .request .Url ;
@@ -44,7 +43,6 @@ public class ResourceUtil
4443 * Used to denote {@code null} in encoded strings.
4544 */
4645 private static final String NULL_VALUE = "null" ;
47- private static final Pattern ESCAPED_ATTRIBUTE_PATTERN = Pattern .compile ("(\\ w)~(\\ w)" );
4846
4947 /**
5048 * Reads resource reference attributes (style, locale, variation) encoded in the given string.
@@ -138,20 +136,6 @@ public static void encodeResourceReferenceAttributes(Url url, ResourceReference
138136 }
139137 }
140138
141- /**
142- * Escapes any occurrences of <em>-</em> character in the style and variation
143- * attributes with <em>~</em>. Any occurrence of <em>~</em> is encoded as <em>~~</em>.
144- *
145- * @param attribute
146- * the attribute to escape
147- * @return the attribute with escaped separator character
148- */
149- public static CharSequence escapeAttributesSeparator (String attribute )
150- {
151- CharSequence tmp = Strings .replaceAll (attribute , "~" , "~~" );
152- return Strings .replaceAll (tmp , "-" , "~" );
153- }
154-
155139 /**
156140 * Parses the string representation of a {@link java.util.Locale} (for example 'en_GB').
157141 *
@@ -241,20 +225,6 @@ public static String readString(IResourceStream resourceStream, Charset charset)
241225 }
242226 }
243227
244- /**
245- * Reverts the escaping applied by {@linkplain #escapeAttributesSeparator(String)} - unescapes
246- * occurrences of <em>~</em> character in the style and variation attributes with <em>-</em>.
247- *
248- * @param attribute
249- * the attribute to unescape
250- * @return the attribute with escaped separator character
251- */
252- public static String unescapeAttributesSeparator (String attribute )
253- {
254- String tmp = ESCAPED_ATTRIBUTE_PATTERN .matcher (attribute ).replaceAll ("$1-$2" );
255- return Strings .replaceAll (tmp , "~~" , "~" ).toString ();
256- }
257-
258228 /**
259229 * Encode the {@code part} in the format <string length encoded in base ten ASCII>~<string data>.
260230 *
0 commit comments