public class I18nUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static Charset |
DEFAULT_CHARSET |
static String |
DEFAULT_ENCODING |
static Locale |
DEFAULT_LOCALE |
static I18nMessageFormatter |
DEFAULT_MESSAGE_FORMATTER |
static String[] |
EMPTY_STRING_ARRAY |
static String |
ISO_8859_1_ENCODING |
static org.nuiton.converter.LocaleConverter |
LOCALE_CONVERTER |
static String |
UTF_8_ENCODING |
| Constructor and Description |
|---|
I18nUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsDirectDirectory(URL url,
String directory)
Test if an url contains the given directory with no recurse seeking.
|
static URL[] |
getClassPathURLsFromJarManifest(URL jarURL) |
static URL[] |
getDeepURLs(URLClassLoader loader)
Returns the all urls to be used in a
URLClassLoader. |
static URL[] |
getURLs(URLClassLoader classLoader)
Recupere la liste des urls d'un
URLClassLoader. |
static List<URL> |
getURLsFromDirectory(File repository,
String pattern)
Retourne la liste des fichiers correspondant au pattern donne, aucun
ordre ne doit être supposé sur les fichiers.
|
static boolean |
isJar(String name)
Verifie si le fichier est un fichier jar.
|
static boolean |
isZip(String name)
Verifie si le fichier est un fichier zip
|
static Locale |
newLocale(String str) |
static Locale |
newLocale(String language,
String country) |
static Locale[] |
parseLocales(String str)
Parse a list of
Locale seperated by comma. |
static Optional<URL[]> |
tryGetDeepURLs(ClassLoader loader)
Returns the all URLs to be used in a
ClassLoader. |
public static final String ISO_8859_1_ENCODING
public static final String UTF_8_ENCODING
public static final String DEFAULT_ENCODING
public static final Charset DEFAULT_CHARSET
public static final I18nMessageFormatter DEFAULT_MESSAGE_FORMATTER
public static final Locale DEFAULT_LOCALE
public static final String[] EMPTY_STRING_ARRAY
public static final org.nuiton.converter.LocaleConverter LOCALE_CONVERTER
public static Locale[] parseLocales(String str) throws IllegalArgumentException
Locale seperated by comma.
Example : fr_FR,en_GBstr - the string representation of locale separated by commaIllegalArgumentException - ia a locale is not validpublic static boolean containsDirectDirectory(URL url, String directory) throws IOException
url - the url to seekdirectory - the directory to findtrue if directory was found, false otherwise.IOException - if any io pbpublic static boolean isJar(String name)
name - nom du fichier a testerpublic static boolean isZip(String name)
name - nom du fichier a testerpublic static List<URL> getURLsFromDirectory(File repository, String pattern)
repository - repertoire dans lequel on recherche les fichierspattern - le nom du fichier a extraire du fichier du repertoire
doit correspondre au pattern (repertoire + nom
compris). si le pattern est null, tous les fichiers
trouvé sont retourné.public static Optional<URL[]> tryGetDeepURLs(ClassLoader loader)
ClassLoader.
If the given classloader is an URLClassLoader, will do the same as getDeepURLs(URLClassLoader).
Otherwise this method will try to find URLs by another way.loader - the classloader (if null will use system one)getDeepURLs(URLClassLoader)public static URL[] getDeepURLs(URLClassLoader loader)
URLClassLoader.
If classloader has only one url and the url is a jar, try to load in
manifest class-path.loader - the classloader (if null will use system one)public static URL[] getURLs(URLClassLoader classLoader)
URLClassLoader.
Note : Un cas particulier est positionné pour JBoss qui utilise la method
getAllURLs.classLoader - le class loader a scannerpublic static URL[] getClassPathURLsFromJarManifest(URL jarURL) throws IOException, URISyntaxException
IOExceptionURISyntaxExceptionCopyright © 2004–2020 CodeLutin. All rights reserved.