public static Locale getCurrentLocale() { Locale locale=null; StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) locale = req.getLocale(); if(locale==null) locale = Locale.getDefault(); return locale; }
private URL getStaticHelpUrl(Klass<?> c, String suffix) { Locale locale = Stapler.getCurrentRequest().getLocale(); String base = "help"+suffix; URL url; url = c.getResource(base + '_' + locale.getLanguage() + '_' + locale.getCountry() + '_' + locale.getVariant() + ".html"); if(url!=null) return url; url = c.getResource(base + '_' + locale.getLanguage() + '_' + locale.getCountry() + ".html"); if(url!=null) return url; url = c.getResource(base + '_' + locale.getLanguage() + ".html"); if(url!=null) return url; // default return c.getResource(base + ".html"); }
/** * Returns the build time stamp in the body. */ public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException { rsp.setContentType("text/plain"); rsp.setCharacterEncoding("US-ASCII"); rsp.setStatus(HttpServletResponse.SC_OK); DateFormat df = format==null ? DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT, Locale.ENGLISH) : new SimpleDateFormat(format,req.getLocale()); rsp.getWriter().print(df.format(getTime())); }
Locale locale = request.getLocale();
if(serveDirIndex) { glob = baseFile.run(new BuildChildPaths(baseFile, req.getLocale()));
public ListBoxModelOptionComparator() { StaplerRequest req = Stapler.getCurrentRequest(); if (req != null) { locale = req.getLocale(); } else { locale = Locale.getDefault(); } collator = Collator.getInstance(locale); }
public static Locale getCurrentLocale() { Locale locale=null; StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) locale = req.getLocale(); if(locale==null) locale = Locale.getDefault(); return locale; }
public Locale get() { Locale locale=null; StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) locale = req.getLocale(); if(locale==null) locale = Locale.getDefault(); return locale; } });
public String getDayName(final int day) { final Calendar ref = Calendar.getInstance(); ref.set(Calendar.DAY_OF_WEEK, day); return String.format(Stapler.getCurrentRequest().getLocale(), "%tA", ref); }
public Locale get() { Locale locale=null; StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) locale = req.getLocale(); if(locale==null) locale = Locale.getDefault(); return locale; } });
public Locale get() { Locale locale=null; StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) locale = req.getLocale(); if(locale==null) locale = Locale.getDefault(); return locale; } });
public Locale get() { Locale locale=null; StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) locale = req.getLocale(); if(locale==null) locale = Locale.getDefault(); return locale; } });
public Locale get() { Locale locale=null; StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) locale = req.getLocale(); if(locale==null) locale = Locale.getDefault(); return locale; } });
public Locale get() { Locale locale=null; StaplerRequest req = Stapler.getCurrentRequest(); if(req!=null) locale = req.getLocale(); if(locale==null) locale = Locale.getDefault(); return locale; } });
private URL getStaticHelpUrl(Klass<?> c, String suffix) { Locale locale = Stapler.getCurrentRequest().getLocale(); String base = "help"+suffix; URL url; url = c.getResource(base + '_' + locale.getLanguage() + '_' + locale.getCountry() + '_' + locale.getVariant() + ".html"); if(url!=null) return url; url = c.getResource(base + '_' + locale.getLanguage() + '_' + locale.getCountry() + ".html"); if(url!=null) return url; url = c.getResource(base + '_' + locale.getLanguage() + ".html"); if(url!=null) return url; // default return c.getResource(base + ".html"); }
/** * Returns the build time stamp in the body. */ public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException { rsp.setContentType("text/plain"); rsp.setCharacterEncoding("US-ASCII"); rsp.setStatus(HttpServletResponse.SC_OK); DateFormat df = format==null ? DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT, Locale.ENGLISH) : new SimpleDateFormat(format,req.getLocale()); rsp.getWriter().print(df.format(getTime())); }
/** * Returns the build time stamp in the body. */ public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException { rsp.setContentType("text/plain"); rsp.setCharacterEncoding("US-ASCII"); rsp.setStatus(HttpServletResponse.SC_OK); DateFormat df = format==null ? DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT, Locale.ENGLISH) : new SimpleDateFormat(format,req.getLocale()); rsp.getWriter().print(df.format(getTime())); }
/** * Returns the build time stamp in the body. */ public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException { rsp.setContentType("text/plain"); rsp.setCharacterEncoding("US-ASCII"); rsp.setStatus(HttpServletResponse.SC_OK); DateFormat df = format==null ? DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT, Locale.ENGLISH) : new SimpleDateFormat(format,req.getLocale()); rsp.getWriter().print(df.format(getTime())); }
/** * Returns the build time stamp in the body. */ public void doBuildTimestamp( StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException { rsp.setContentType("text/plain"); rsp.setCharacterEncoding("US-ASCII"); rsp.setStatus(HttpServletResponse.SC_OK); DateFormat df = format==null ? DateFormat.getDateTimeInstance(DateFormat.SHORT,DateFormat.SHORT, Locale.ENGLISH) : new SimpleDateFormat(format,req.getLocale()); rsp.getWriter().print(df.format(getTime())); }
/** * Returns the build time stamp in the body. */ public void doBuildTimestamp(StaplerRequest req, StaplerResponse rsp, @QueryParameter String format) throws IOException { rsp.setContentType("text/plain"); rsp.setCharacterEncoding("US-ASCII"); rsp.setStatus(HttpServletResponse.SC_OK); DateFormat df = format == null ? DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.ENGLISH) : new SimpleDateFormat(format, req.getLocale()); rsp.getWriter().print(df.format(getTime())); }