private static class I18nRepository.MultipleLocale extends Object implements Iterable<I18nFile>
This class scans for locale directory into given base directory; locale directory name should match
LOCALE_PATTERN
. It is considered a bug if no locale directory found. Then scan locale directory for files
matching given file filter. If sub-path argument is provided add it to locale directory and scan resulting
directory. It is also considered a bug if no matching files found.
Matching files are added to internal list but no particular order is guaranteed.
Modifier and Type | Field and Description |
---|---|
private List<I18nFile> |
files
Repository files list contains files from all locale directories.
|
private static Pattern |
LOCALE_PATTERN
Locale pattern has 2 lower case letters for language code and 2 upper case letters for country code, separated by
hyphen.
|
Constructor and Description |
---|
MultipleLocale(File baseDir,
String subpath,
FileFilter fileFilter)
Construct multiple locale repository for requested base directory, file filter and optional sub-path.
|
Modifier and Type | Method and Description |
---|---|
Iterator<I18nFile> |
iterator()
Return and iterator over repository files.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
private static final Pattern LOCALE_PATTERN
public MultipleLocale(File baseDir, String subpath, FileFilter fileFilter) throws IOException
baseDir
- repository base directory,subpath
- optional sub-path, null if unused,fileFilter
- file filter, possibly accepting all.IOException
- if listing directories content fails.BugError
- if no locale directories found on base directory, sub-path directory not found or no files
matching file filter found on a locale directory.Copyright © 2018. All rights reserved.