Package org.zkoss.zk.ui.http
Class Utils
- java.lang.Object
-
- org.zkoss.zk.ui.http.Utils
-
public class Utils extends java.lang.Object
A collection of utilities for this package.- Since:
- 2.4.1
- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
checkUpdateURI(java.lang.String updateURI, java.lang.String info)
Checks the update URI.static int
get2DigitYearStart()
Returns the start year only for the format using "yy" pattern, change the parse result in the 100 years span after that year. 2DigitYearStart should not be negative.static int
getFirstDayOfWeek()
Returns the first day of the week, or -1 if no defined by the application.static int
getFirstDayOfWeek(Session sess)
Returns the first day of the week of the given session, or -1 if no defined by the application.static void
updateDebugJS(WebApp wapp, boolean debug)
Update the status of debug-js.
-
-
-
Method Detail
-
updateDebugJS
public static void updateDebugJS(WebApp wapp, boolean debug)
Update the status of debug-js. It is called byConfiguration.setDebugJS(boolean)
to change the loading of JavaScript files dynamically.- Since:
- 5.0.3
-
getFirstDayOfWeek
public static final int getFirstDayOfWeek()
Returns the first day of the week, or -1 if no defined by the application. It is the same asgetFirstDayOfWeek(Sessions.getCurrent())
.- Since:
- 5.0.3
-
getFirstDayOfWeek
public static final int getFirstDayOfWeek(Session sess)
Returns the first day of the week of the given session, or -1 if no defined by the application. It searches the following attributes and properties until found. Notice that it doesn't look forCalendar.getFirstDayOfWeek()
.- Session attribute:
Attributes.PREFERRED_FIRST_DAY_OF_WEEK
- Application attribute:
Attributes.PREFERRED_FIRST_DAY_OF_WEEK
- Library property:
Attributes.PREFERRED_FIRST_DAY_OF_WEEK
- Parameters:
sess
- the session to look at. Ignored if null.- Since:
- 5.0.3
- Session attribute:
-
get2DigitYearStart
public static final int get2DigitYearStart() throws java.lang.NumberFormatException
Returns the start year only for the format using "yy" pattern, change the parse result in the 100 years span after that year. 2DigitYearStart should not be negative. for example, start year 1950 will parse [0-49] : 2000-2049 and [50-99] : 1950-1999Default: 1929
Library property:
Attributes.PREFERRED_2DIGITYEARSTART
- Throws:
java.lang.NumberFormatException
- Since:
- 8.6.2
-
checkUpdateURI
public static final java.lang.String checkUpdateURI(java.lang.String updateURI, java.lang.String info) throws javax.servlet.ServletException
Checks the update URI.- Parameters:
updateURI
- the update URI to be checked.info
- the info to show if updateURI is incorrect.- Returns:
- the update URI (by removing ending / if any)
- Throws:
javax.servlet.ServletException
- if updateURI is incorrect.- Since:
- 5.0.5
-
-