public List<MethodParameterExtractor> getExtractors() { if (extractors == null) { extractors = ServiceLocator.locateAll(MethodParameterExtractor.class); } return extractors; }
public static String getPippoLogo() { return StringUtils.format(PIPPO_LOGO, getPippoVersion()); }
public boolean isEmpty() { return values == null || values.length == 0 || StringUtils.isNullOrEmpty(values[0]); }
private Cookie getSessionIdCookie(HttpServletRequest request) { return CookieUtils.getCookie(request, SESSION_ID_COOKIE_NAME); }
public PippoRuntimeException(Throwable cause, String message, Object... args) { super(StringUtils.format(message, args), cause); }
/** * Prefix the given path with the application path. * * @param path * @return an absolute path */ protected String prefixApplicationPath(String path) { return applicationPath + StringUtils.addStart(path, "/"); }
public static String getHmacSHA256(String message, String secretKey) { return hmacDigest(message, secretKey, HMAC_SHA256); }
/** * Returns the content-type from a file name. If none is found returning * application/octet-stream<br/> * For a text-based content-type, also return the encoding suffix eg. * <em>"text/plain; charset=utf-8"</em> * * @param filename the file name * @return the content-type deduced from the file extension. */ public String getContentType(String filename) { return getContentType(filename, "application/octet-stream"); }
/** * Shortcut to * {@code * getResourceAsString(getClass(), resource); * } */ public static String getResourceAsString(String resource) throws IOException { return getResourceAsString(IoUtils.class, resource); }
protected void notify(Notifier<T> notifier) { for (T listener : listeners) { notifier.notify(listener); } }
/** * Constructs an CSRF handler with a dynamically generated SecretKey. */ public CSRFHandler() { this(CryptoUtils.generateSecretKey()); }
/** * Returns the mimetype from a file name * * @param filename the file name * @return the mimetype or the empty string if not found */ public String getMimeType(String filename) { return getMimeType(filename, ""); }
public List<Cookie> getCookies() { return CookieUtils.getCookies(httpServletRequest); }
/** * Can be used to parse http times. For instance something like a http * header Date: Tue, 26 Mar 2013 13:47:13 GMT * <p/> * INFO: consider the JodaTime based * DateUtil.parseHttpDateFormatToDateTime(...) version * * @param httpDateFormat in http format: Date: Tue, 26 Mar 2013 13:47:13 GMT * @return A nice "Date" object containing that http timestamp. * @throws ParseException If something goes wrong. */ public static Date parseHttpDateFormat(String httpDateFormat) throws ParseException { return parseHttpDateFormatToDateTime(httpDateFormat); }
public Cookie getCookie(String name) { return CookieUtils.getCookie(httpServletRequest, name); }
public PippoRuntimeException(String message, Object... args) { super(StringUtils.format(message, args)); }
public static String getHmacSHA1(String message, String secretKey) { return hmacDigest(message, secretKey, HMAC_SHA1); }
public static String getHmacMD5(String message, String secretKey) { return hmacDigest(message, secretKey, HMAC_MD5); }