Package org.apache.wicket.util.resource
Class ResourceUtils
- java.lang.Object
-
- org.apache.wicket.util.resource.ResourceUtils
-
public class ResourceUtils extends Object
- Author:
- Juergen Donnerstag
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResourceUtils.PathLocale
-
Field Summary
Fields Modifier and Type Field Description static String
MIN_POSTFIX_DEFAULT
The default postfix for minified names (ex: /css/mystyle.min.css)static String
MIN_POSTFIX_DEFAULT_AS_EXTENSION
The default postfix for minified names (ex: /css/mystyle.min.css)
-
Constructor Summary
Constructors Constructor Description ResourceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ResourceUtils.PathLocale
getLocaleFromFilename(String path)
Extract the locale from the filename taking into account possible minimized resource name.static String
getMinifiedName(String name, String minPostfix)
Return the minified version for a given resource name.
-
-
-
Field Detail
-
MIN_POSTFIX_DEFAULT
public static final String MIN_POSTFIX_DEFAULT
The default postfix for minified names (ex: /css/mystyle.min.css)- See Also:
- Constant Field Values
-
MIN_POSTFIX_DEFAULT_AS_EXTENSION
public static final String MIN_POSTFIX_DEFAULT_AS_EXTENSION
The default postfix for minified names (ex: /css/mystyle.min.css)- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResourceUtils
public ResourceUtils()
-
-
Method Detail
-
getMinifiedName
public static String getMinifiedName(String name, String minPostfix)
Return the minified version for a given resource name. For example '/css/coolTheme.css' becomes '/css/coolTheme.min.css'- Parameters:
name
- The original resource nameminPostfix
- The postfix to use for minified name- Returns:
- The minified resource name
-
getLocaleFromFilename
public static ResourceUtils.PathLocale getLocaleFromFilename(String path)
Extract the locale from the filename taking into account possible minimized resource name. E.g.file_us_EN.min.js
will correctly determine a locale ofus_EN
by stripping the.min
from the filename, the filename returned will befile.min.js
, if you want the.min
to be removed as well, usegetLocaleFromFilename(String)
instead.- Parameters:
path
- The file path- Returns:
- The updated path, without the locale
-
-