ResourceBundle bundle = ResourceBundle.getBundle("com.example.i18n.text", new UTF8Control());
/** * @return {@code true} if the JBoss VFS2 infrastructure is present in the * classpath, otherwise {@code false}. */ public static boolean isJBossVFS2Available() { if (jbossVFSv2Available == null) { jbossVFSv2Available = ClassUtils.isPresent("org.jboss.virtual.VFS"); } return jbossVFSv2Available; }
public static void containsNoNulls(Iterable<?> collection, String message) { for (Object object : collection) { notNull(object, message); } }
public static void containsNoEmpties(Iterable<String> collection, String message) { for (String object : collection) { notBlank(object, message); } }
/** * Write bytes from the specified byte array to the stream. * * @param b * the byte array containing the bytes to write * @throws IOException * if an I/O error occurs */ @Override public void write(final byte[] b) throws IOException { write(b, 0, b.length); }
/** * Normalizes a path and adds a separator at its start and its end. * * @param path * the path * @return the normalized path */ public static String asDirPath(String path) { return (URL_SEPARATOR + normalizePath(path) + URL_SEPARATOR); }
/** * Calculate the MD5 digest of the given bytes. * * @param bytes * the bytes to calculate the digest over * @return the digest */ public static byte[] sha1Digest(byte[] bytes) { return digest(SHA1_ALGORITHM_NAME, bytes); }
/** * Check that the given String is neither {@code null} nor of length 0. Note: * Will return {@code true} for a String that purely consists of whitespace. * * @param str * the String to check (may be {@code null}) * @return {@code true} if the String is not null and has length * @see #hasLength(CharSequence) */ public static boolean hasLength(String str) { return hasLength((CharSequence) str); }
/** * @return {@code true} if Thymeleaf is present in the classpath, otherwise * {@code false}. */ public static boolean isThymeleafAvailable() { if (thymeleafAvailable == null) { thymeleafAvailable = ClassUtils.isPresent("org.thymeleaf.TemplateEngine"); } return thymeleafAvailable; }
public static void containsNoNulls(Object[] array, String message) { for (Object object : array) { notNull(object, message); } }
/** * Write a single byte to the stream. * * @param b * the byte to write * @throws IOException * if an I/O error occurs */ @Override public void write(final int b) throws IOException { write(new byte[] { (byte) b }, 0, 1); }
/** * Normalizes a path and adds a separator at its start. * * @param path * @return */ public static String asPath(String path) { return (URL_SEPARATOR + normalizePath(path)); }
/** * Calculate the MD5 digest of the given bytes. * * @param bytes * the bytes to calculate the digest over * @return the digest */ public static byte[] md5Digest(byte[] bytes) { return digest(MD5_ALGORITHM_NAME, bytes); }
/** * Check that the given String is neither {@code null} nor of length 0. Note: * Will return {@code true} for a String that purely consists of whitespace. * * @param str * the String to check (may be {@code null}) * @return {@code true} if the String is not null and has length * @see #hasLength(CharSequence) */ public static boolean hasLength(String str) { return hasLength((CharSequence) str); }
/** * @return {@code true} if the JSTL is present in the classpath, otherwise * {@code false}. */ public static boolean isJstlAvailable() { if (jstlAvailable == null) { jstlAvailable = ClassUtils.isPresent("javax.servlet.jsp.jstl.core.Config"); } return jstlAvailable; }
/** * Write bytes from the specified byte array to the stream. * * @param b * the byte array containing the bytes to write * @throws IOException * if an I/O error occurs */ @Override public void write(final byte[] b) throws IOException { write(b, 0, b.length); }
/** * Normalizes a path and adds a separator at its start. * * @param path * @return */ public static String asPath(String path) { return (URL_SEPARATOR + normalizePath(path)); }
/** * Calculate the MD5 digest of the given bytes. * * @param bytes * the bytes to calculate the digest over * @return the digest */ public static byte[] md5Digest(byte[] bytes) { return digest(MD5_ALGORITHM_NAME, bytes); }
/** * @return {@code true} if the JBoss VFS3 infrastructure is present in the * classpath, otherwise {@code false}. */ public static boolean isJBossVFS3Available() { if (jbossVFSv3Available == null) { jbossVFSv3Available = ClassUtils.isPresent("org.jboss.vfs.VFS"); } return jbossVFSv3Available; }
/** * Write a single byte to the stream. * * @param b * the byte to write * @throws IOException * if an I/O error occurs */ @Override public void write(final int b) throws IOException { write(new byte[] { (byte) b }, 0, 1); }