public abstract class AbstractDictionaryProvider extends Object implements DictionaryProvider
| Constructor and Description |
|---|
AbstractDictionaryProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFromInstallDirectory(List<Locale> list,
File dictionariesDirectory) |
protected void |
addFromSources(List<Locale> list) |
protected void |
addLocaleFromInstalledFile(List<Locale> list,
File file) |
protected void |
addLocaleFromSource(List<Locale> list,
Matcher matcher) |
protected FileFilter |
createInstalledDictionaryFileFilter() |
protected URL |
createLocalCopy(URL dictURL,
ProgressListener listener)
Copy URL to
getLocalStorageDir(). |
protected Locale |
createLocaleFrom(Matcher matcher) |
List<Locale> |
getAvailableLocales()
Get all Availables locales that are not installed
|
protected abstract URI |
getDefaultDictionariesSource()
Obtain the default source of dictionaries
|
URI |
getDictionariesSource()
Get the URI where dictionaries are ready for install.
|
protected abstract Pattern |
getDictionariesSourceFilesPattern()
El patrón para obtener los diccionarios remotos.
|
protected String |
getEncoding(URLConnection connection) |
protected abstract Pattern |
getInstalledDictionariesFilesPattern()
Nos da el patrón para obetener los ficheros de los diccionarios instalados localmente.
|
List<Locale> |
getInstalledLocales() |
protected Locale |
getLocaleForFile(File file) |
protected File |
getLocalStorageDir() |
boolean |
isForLocale(Locale locale) |
protected String |
readAsString(InputStream in,
String encoding) |
void |
setDictionariesSource(URI uri)
Set the remote URI for dictionaries sources.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDictionary, getDisplayName, install, install, uninstallprotected abstract Pattern getDictionariesSourceFilesPattern()
protected abstract Pattern getInstalledDictionariesFilesPattern()
public boolean isForLocale(Locale locale)
isForLocale in interface DictionaryProviderlocale - locale to check forprotected FileFilter createInstalledDictionaryFileFilter()
protected File getLocalStorageDir()
protected void addFromInstallDirectory(List<Locale> list, File dictionariesDirectory)
protected abstract URI getDefaultDictionariesSource() throws URISyntaxException
URISyntaxExceptionpublic void setDictionariesSource(URI uri)
uri - the URI where are the dictionaries ready for install.public URI getDictionariesSource()
protected String readAsString(InputStream in, String encoding) throws UnsupportedEncodingException, IOException
protected String getEncoding(URLConnection connection)
protected URL createLocalCopy(URL dictURL, ProgressListener listener) throws IOException
getLocalStorageDir().IOExceptionpublic List<Locale> getInstalledLocales()
getInstalledLocales in interface DictionaryProviderpublic List<Locale> getAvailableLocales()
getAvailableLocales in interface DictionaryProviderCopyright © 2020. All rights reserved.