|
|
|
@ -24,8 +24,8 @@ import java.net.MalformedURLException;
|
|
|
|
|
import net.yacy.cora.protocol.RequestHeader;
|
|
|
|
|
import net.yacy.cora.services.federated.yacy.CacheStrategy;
|
|
|
|
|
import net.yacy.document.LibraryProvider;
|
|
|
|
|
import net.yacy.document.geolocalization.GeonamesLocalization;
|
|
|
|
|
import net.yacy.document.geolocalization.OpenGeoDBLocalization;
|
|
|
|
|
import net.yacy.document.geolocalization.GeonamesLocation;
|
|
|
|
|
import net.yacy.document.geolocalization.OpenGeoDBLocation;
|
|
|
|
|
import net.yacy.kelondro.data.meta.DigestURI;
|
|
|
|
|
import net.yacy.kelondro.logging.Log;
|
|
|
|
|
import net.yacy.kelondro.util.FileUtils;
|
|
|
|
@ -68,7 +68,7 @@ public class DictionaryLoader_p {
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.GEON0.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, false);
|
|
|
|
|
final byte[] b = response.getContent();
|
|
|
|
|
FileUtils.copy(b, LibraryProvider.Dictionary.GEON0.file());
|
|
|
|
|
LibraryProvider.geoLoc.addLocalization(LibraryProvider.Dictionary.GEON0.nickname, new GeonamesLocalization(LibraryProvider.Dictionary.GEON0.file()));
|
|
|
|
|
LibraryProvider.geoLoc.addLocalization(LibraryProvider.Dictionary.GEON0.nickname, new GeonamesLocation(LibraryProvider.Dictionary.GEON0.file()));
|
|
|
|
|
LibraryProvider.autotagging.addPlaces(LibraryProvider.geoLoc);
|
|
|
|
|
prop.put("geon0Status", LibraryProvider.Dictionary.GEON0.file().exists() ? 1 : 0);
|
|
|
|
|
prop.put("geon0ActionLoaded", 1);
|
|
|
|
@ -98,7 +98,7 @@ public class DictionaryLoader_p {
|
|
|
|
|
|
|
|
|
|
if (post.containsKey("geon0Activate")) {
|
|
|
|
|
LibraryProvider.Dictionary.GEON0.fileDisabled().renameTo(LibraryProvider.Dictionary.GEON0.file());
|
|
|
|
|
LibraryProvider.geoLoc.addLocalization(LibraryProvider.Dictionary.GEON0.nickname, new GeonamesLocalization(LibraryProvider.Dictionary.GEON0.file()));
|
|
|
|
|
LibraryProvider.geoLoc.addLocalization(LibraryProvider.Dictionary.GEON0.nickname, new GeonamesLocation(LibraryProvider.Dictionary.GEON0.file()));
|
|
|
|
|
LibraryProvider.autotagging.addPlaces(LibraryProvider.geoLoc);
|
|
|
|
|
prop.put("geon0ActionActivated", 1);
|
|
|
|
|
}
|
|
|
|
@ -111,7 +111,7 @@ public class DictionaryLoader_p {
|
|
|
|
|
final byte[] b = response.getContent();
|
|
|
|
|
FileUtils.copy(b, LibraryProvider.Dictionary.GEODB1.file());
|
|
|
|
|
LibraryProvider.geoLoc.removeLocalization(LibraryProvider.Dictionary.GEODB0.nickname);
|
|
|
|
|
LibraryProvider.geoLoc.addLocalization(LibraryProvider.Dictionary.GEODB1.nickname, new OpenGeoDBLocalization(LibraryProvider.Dictionary.GEODB1.file(), false));
|
|
|
|
|
LibraryProvider.geoLoc.addLocalization(LibraryProvider.Dictionary.GEODB1.nickname, new OpenGeoDBLocation(LibraryProvider.Dictionary.GEODB1.file(), false));
|
|
|
|
|
LibraryProvider.autotagging.addPlaces(LibraryProvider.geoLoc);
|
|
|
|
|
prop.put("geo1Status", LibraryProvider.Dictionary.GEODB1.file().exists() ? 1 : 0);
|
|
|
|
|
prop.put("geo1ActionLoaded", 1);
|
|
|
|
@ -141,7 +141,7 @@ public class DictionaryLoader_p {
|
|
|
|
|
|
|
|
|
|
if (post.containsKey("geo1Activate")) {
|
|
|
|
|
LibraryProvider.Dictionary.GEODB1.fileDisabled().renameTo(LibraryProvider.Dictionary.GEODB1.file());
|
|
|
|
|
LibraryProvider.geoLoc.addLocalization(LibraryProvider.Dictionary.GEODB1.nickname, new OpenGeoDBLocalization(LibraryProvider.Dictionary.GEODB1.file(), false));
|
|
|
|
|
LibraryProvider.geoLoc.addLocalization(LibraryProvider.Dictionary.GEODB1.nickname, new OpenGeoDBLocation(LibraryProvider.Dictionary.GEODB1.file(), false));
|
|
|
|
|
LibraryProvider.autotagging.addPlaces(LibraryProvider.geoLoc);
|
|
|
|
|
prop.put("geo1ActionActivated", 1);
|
|
|
|
|
}
|
|
|
|
|