public class LanguageProfileReader extends Object
LanguageProfiles.| Constructor and Description |
|---|
LanguageProfileReader() |
| Modifier and Type | Method and Description |
|---|---|
List<LanguageProfile> |
read(ClassLoader classLoader,
String profileDirectory,
Collection<String> profileFileNames)
Load profiles from the classpath in a specific directory.
|
List<LanguageProfile> |
read(Collection<String> profileFileNames)
Same as
read(ClassLoader, String, java.util.Collection) using the class loader of this class,
and the default profiles directory of this library. |
LanguageProfile |
read(File profileFile)
Reads a
LanguageProfile from a File in UTF-8. |
LanguageProfile |
read(InputStream inputStream)
Reads a
LanguageProfile from an InputStream in UTF-8. |
List<LanguageProfile> |
read(String profileDirectory,
Collection<String> profileFileNames)
Same as
read(ClassLoader, String, java.util.Collection) using the class loader of this class. |
List<LanguageProfile> |
readAll()
Deprecated.
renamed to readAllBuiltIn()
|
List<LanguageProfile> |
readAll(File path)
Loads all profiles from the specified directory.
|
List<LanguageProfile> |
readAllBuiltIn()
Reads all built-in language profiles from the "languages" folder (shipped with the jar).
|
List<LanguageProfile> |
readBuiltIn(Collection<LdLocale> languages) |
LanguageProfile |
readBuiltIn(LdLocale locale) |
public LanguageProfile read(File profileFile) throws IOException
LanguageProfile from a File in UTF-8.IOExceptionpublic LanguageProfile read(InputStream inputStream) throws IOException
LanguageProfile from an InputStream in UTF-8.IOExceptionpublic List<LanguageProfile> read(ClassLoader classLoader, String profileDirectory, Collection<String> profileFileNames) throws IOException
This is usually used to load built-in profiles, shipped with the jar.
classLoader - the ClassLoader to load the profiles from. Use MyClass.class.getClassLoader()profileDirectory - profile directory path inside the classpath. The default profiles are in "languages".profileFileNames - for example ["en", "fr", "de"].IOExceptionpublic List<LanguageProfile> read(String profileDirectory, Collection<String> profileFileNames) throws IOException
read(ClassLoader, String, java.util.Collection) using the class loader of this class.IOExceptionpublic List<LanguageProfile> read(Collection<String> profileFileNames) throws IOException
read(ClassLoader, String, java.util.Collection) using the class loader of this class,
and the default profiles directory of this library.IOException@NotNull public LanguageProfile readBuiltIn(@NotNull LdLocale locale) throws IOException
IOException@NotNull public List<LanguageProfile> readBuiltIn(@NotNull Collection<LdLocale> languages) throws IOException
IOExceptionpublic List<LanguageProfile> readAll() throws IOException
IOExceptionpublic List<LanguageProfile> readAllBuiltIn() throws IOException
IOExceptionpublic List<LanguageProfile> readAll(File path) throws IOException
path - profile directory pathIOExceptionCopyright © 2015. All rights reserved.