public class ResourceUtil extends Object
Modifier and Type | Method and Description |
---|---|
static ResourceReference.UrlAttributes |
decodeResourceReferenceAttributes(String encodedAttributes)
Reads resource reference attributes (style, locale, variation) encoded in the given string.
|
static ResourceReference.UrlAttributes |
decodeResourceReferenceAttributes(Url url)
Reads resource reference attributes (style, locale, variation) encoded in the given URL.
|
static String |
encodeResourceReferenceAttributes(ResourceReference.UrlAttributes attributes)
Encodes the given resource reference attributes returning the corresponding textual representation.
|
static void |
encodeResourceReferenceAttributes(Url url,
ResourceReference reference)
Encodes the attributes of the given resource reference in the specified url.
|
static CharSequence |
escapeAttributesSeparator(String attribute)
Escapes any occurrences of - character in the style and variation
attributes with ~.
|
static Locale |
parseLocale(String locale)
Parses the string representation of a
Locale (for example 'en_GB'). |
static String |
readString(IResourceStream resourceStream)
read string with platform default encoding from resource stream
|
static String |
readString(IResourceStream resourceStream,
Charset charset)
read string with specified encoding from resource stream
|
static String |
unescapeAttributesSeparator(String attribute)
Reverts the escaping applied by escapeAttributesSeparator(String) - unescapes
occurrences of ~ character in the style and variation attributes with -.
|
public static ResourceReference.UrlAttributes decodeResourceReferenceAttributes(String encodedAttributes)
encodedAttributes
- the string containing the resource attributesResourceReference.UrlAttributes
public static ResourceReference.UrlAttributes decodeResourceReferenceAttributes(Url url)
url
- the url containing the resource attributesResourceReference.UrlAttributes
public static String encodeResourceReferenceAttributes(ResourceReference.UrlAttributes attributes)
attributes
- the resource reference attributes to encodeResourceReference.UrlAttributes
public static void encodeResourceReferenceAttributes(Url url, ResourceReference reference)
url
- the resource reference attributes to encodereference
- ResourceReference.UrlAttributes
,
Url
public static CharSequence escapeAttributesSeparator(String attribute)
attribute
- the attribute to escapepublic static Locale parseLocale(String locale)
Locale
(for example 'en_GB').public static String readString(IResourceStream resourceStream)
resourceStream
- readString(org.apache.wicket.util.resource.IResourceStream, java.nio.charset.Charset)
public static String readString(IResourceStream resourceStream, Charset charset)
resourceStream
- string sourcecharset
- charset for the string encoding (use null
for platform default)public static String unescapeAttributesSeparator(String attribute)
attribute
- the attribute to unescapeCopyright © 2006–2022 Apache Software Foundation. All rights reserved.