Package org.nuiton.i18n
Class I18nUtil
java.lang.Object
org.nuiton.i18n.I18nUtil
- Author:
- Tony Chemit - chemit@codelutin.com
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsDirectDirectory(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 aURLClassLoader.static URL[]getURLs(URLClassLoader classLoader) Recupere la liste des urls d'unURLClassLoader.getURLsFromDirectory(File repository, String pattern) Retourne la liste des fichiers correspondant au pattern donne, aucun ordre ne doit être supposé sur les fichiers.static booleanVerifie si le fichier est un fichier jar.static booleanVerifie si le fichier est un fichier zipstatic Localestatic Localestatic Locale[]parseLocales(String str) Parse a list ofLocaleseperated by comma.
-
Field Details
-
ISO_8859_1_ENCODING
- See Also:
-
UTF_8_ENCODING
- See Also:
-
DEFAULT_ENCODING
- See Also:
-
DEFAULT_CHARSET
-
DEFAULT_MESSAGE_FORMATTER
-
DEFAULT_LOCALE
-
EMPTY_STRING_ARRAY
-
LOCALE_CONVERTER
public static final org.nuiton.converter.LocaleConverter LOCALE_CONVERTER
-
-
Constructor Details
-
I18nUtil
public I18nUtil()
-
-
Method Details
-
parseLocales
Parse a list ofLocaleseperated by comma. Example : fr_FR,en_GB- Parameters:
str- the string representation of locale separated by comma- Returns:
- list of available locales
- Throws:
IllegalArgumentException- ia a locale is not valid
-
newLocale
-
newLocale
-
containsDirectDirectory
Test if an url contains the given directory with no recurse seeking.- Parameters:
url- the url to seekdirectory- the directory to find- Returns:
trueif directory was found,falseotherwise.- Throws:
IOException- if any io pb
-
isJar
Verifie si le fichier est un fichier jar.- Parameters:
name- nom du fichier a tester- Returns:
- vrai si le fichier se termine par .jar faux sinon
-
isZip
Verifie si le fichier est un fichier zip- Parameters:
name- nom du fichier a tester- Returns:
- vrai si le fichier se termine par .zip faux sinon
-
getURLsFromDirectory
Retourne la liste des fichiers correspondant au pattern donne, aucun ordre ne doit être supposé sur les fichiers.- Parameters:
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é.- Returns:
- la liste des urls correspondant au pattern
-
getDeepURLs
Returns the all urls to be used in aURLClassLoader. If classloader has only one url and the url is a jar, try to load in manifest class-path.- Parameters:
loader- the classloader (if null will use system one)- Returns:
- all the url found in the classloader
-
getURLs
Recupere la liste des urls d'unURLClassLoader. Note : Un cas particulier est positionné pour JBoss qui utilise la method getAllURLs.- Parameters:
classLoader- le class loader a scanner- Returns:
- les urls du classloade.
-
getClassPathURLsFromJarManifest
public static URL[] getClassPathURLsFromJarManifest(URL jarURL) throws IOException, URISyntaxException - Throws:
IOExceptionURISyntaxException
-