public class LanguageProfileReader extends Object
LanguageProfile
s.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).
|
@NotNull List<LanguageProfile> |
readBuiltIn(@NotNull Collection<LdLocale> languages) |
@NotNull LanguageProfile |
readBuiltIn(@NotNull LdLocale locale) |
public LanguageProfile read(File profileFile) throws IOException
LanguageProfile
from a File in UTF-8.IOException
public LanguageProfile read(InputStream inputStream) throws IOException
LanguageProfile
from an InputStream in UTF-8.IOException
public 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"].IOException
public List<LanguageProfile> read(String profileDirectory, Collection<String> profileFileNames) throws IOException
read(ClassLoader, String, java.util.Collection)
using the class loader of this class.IOException
public 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 @NotNull LanguageProfile readBuiltIn(@NotNull @NotNull LdLocale locale) throws IOException
IOException
@NotNull public @NotNull List<LanguageProfile> readBuiltIn(@NotNull @NotNull Collection<LdLocale> languages) throws IOException
IOException
public List<LanguageProfile> readAll() throws IOException
IOException
public List<LanguageProfile> readAllBuiltIn() throws IOException
IOException
public List<LanguageProfile> readAll(File path) throws IOException
path
- profile directory pathIOException
Copyright © 2016. All rights reserved.