Class Utils

java.lang.Object
org.zkoss.zk.ui.http.Utils

public class Utils extends Object
A collection of utilities for this package.
Since:
2.4.1
Author:
tomyeh
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • updateDebugJS

      public static void updateDebugJS(WebApp wapp, boolean debug)
      Update the status of debug-js. It is called by Configuration.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 as getFirstDayOfWeek(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 for Calendar.getFirstDayOfWeek().
      1. Session attribute: Attributes.PREFERRED_FIRST_DAY_OF_WEEK
      2. Application attribute: Attributes.PREFERRED_FIRST_DAY_OF_WEEK
      3. Library property: Attributes.PREFERRED_FIRST_DAY_OF_WEEK
      Parameters:
      sess - the session to look at. Ignored if null.
      Since:
      5.0.3
    • get2DigitYearStart

      public static final int get2DigitYearStart() throws 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-1999

      Default: 1929

      Library property: Attributes.PREFERRED_2DIGITYEARSTART

      Throws:
      NumberFormatException
      Since:
      8.6.2
    • checkUpdateURI

      public static final String checkUpdateURI(String updateURI, String info) throws jakarta.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:
      jakarta.servlet.ServletException - if updateURI is incorrect.
      Since:
      5.0.5