|
|
|
@ -27,7 +27,6 @@ import net.yacy.cora.geo.OpenGeoDBLocation;
|
|
|
|
|
import net.yacy.cora.protocol.ClientIdentification;
|
|
|
|
|
import net.yacy.cora.protocol.RequestHeader;
|
|
|
|
|
import net.yacy.cora.util.ConcurrentLog;
|
|
|
|
|
import net.yacy.crawler.data.CrawlQueues;
|
|
|
|
|
import net.yacy.crawler.retrieval.Response;
|
|
|
|
|
import net.yacy.document.LibraryProvider;
|
|
|
|
|
import net.yacy.kelondro.data.meta.DigestURI;
|
|
|
|
@ -67,7 +66,7 @@ public class DictionaryLoader_p {
|
|
|
|
|
if (post.containsKey("geon0Load")) {
|
|
|
|
|
// load from the net
|
|
|
|
|
try {
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.GEON0.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, CrawlQueues.queuedMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.GEON0.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, ClientIdentification.minLoadDelay(), ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final byte[] b = response.getContent();
|
|
|
|
|
FileUtils.copy(b, LibraryProvider.Dictionary.GEON0.file());
|
|
|
|
|
LibraryProvider.geoLoc.activateLocation(LibraryProvider.Dictionary.GEON0.nickname, new GeonamesLocation(LibraryProvider.Dictionary.GEON0.file(), null, -1));
|
|
|
|
@ -109,7 +108,7 @@ public class DictionaryLoader_p {
|
|
|
|
|
if (post.containsKey("geon1Load")) {
|
|
|
|
|
// load from the net
|
|
|
|
|
try {
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.GEON1.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, CrawlQueues.queuedMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.GEON1.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, ClientIdentification.minLoadDelay(), ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final byte[] b = response.getContent();
|
|
|
|
|
FileUtils.copy(b, LibraryProvider.Dictionary.GEON1.file());
|
|
|
|
|
LibraryProvider.geoLoc.activateLocation(LibraryProvider.Dictionary.GEON1.nickname, new GeonamesLocation(LibraryProvider.Dictionary.GEON1.file(), null, -1));
|
|
|
|
@ -151,7 +150,7 @@ public class DictionaryLoader_p {
|
|
|
|
|
if (post.containsKey("geon2Load")) {
|
|
|
|
|
// load from the net
|
|
|
|
|
try {
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.GEON2.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, CrawlQueues.queuedMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.GEON2.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, ClientIdentification.minLoadDelay(), ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final byte[] b = response.getContent();
|
|
|
|
|
FileUtils.copy(b, LibraryProvider.Dictionary.GEON2.file());
|
|
|
|
|
LibraryProvider.geoLoc.activateLocation(LibraryProvider.Dictionary.GEON2.nickname, new GeonamesLocation(LibraryProvider.Dictionary.GEON2.file(), null, 100000));
|
|
|
|
@ -193,7 +192,7 @@ public class DictionaryLoader_p {
|
|
|
|
|
if (post.containsKey("geo1Load")) {
|
|
|
|
|
// load from the net
|
|
|
|
|
try {
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.GEODB1.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, CrawlQueues.queuedMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.GEODB1.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, ClientIdentification.minLoadDelay(), ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final byte[] b = response.getContent();
|
|
|
|
|
FileUtils.copy(b, LibraryProvider.Dictionary.GEODB1.file());
|
|
|
|
|
LibraryProvider.geoLoc.deactivateLocalization(LibraryProvider.Dictionary.GEODB1.nickname);
|
|
|
|
@ -236,7 +235,7 @@ public class DictionaryLoader_p {
|
|
|
|
|
if (post.containsKey("drw0Load")) {
|
|
|
|
|
// load from the net
|
|
|
|
|
try {
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.DRW0.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, CrawlQueues.queuedMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.DRW0.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, ClientIdentification.minLoadDelay(), ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final byte[] b = response.getContent();
|
|
|
|
|
FileUtils.copy(b, LibraryProvider.Dictionary.DRW0.file());
|
|
|
|
|
LibraryProvider.activateDeReWo();
|
|
|
|
@ -280,7 +279,7 @@ public class DictionaryLoader_p {
|
|
|
|
|
if (post.containsKey("pnd0Load")) {
|
|
|
|
|
// load from the net
|
|
|
|
|
try {
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.PND0.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, CrawlQueues.queuedMinLoadDelay, ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final Response response = sb.loader.load(sb.loader.request(new DigestURI(LibraryProvider.Dictionary.PND0.url), false, true), CacheStrategy.NOCACHE, Integer.MAX_VALUE, null, ClientIdentification.minLoadDelay(), ClientIdentification.DEFAULT_TIMEOUT);
|
|
|
|
|
final byte[] b = response.getContent();
|
|
|
|
|
FileUtils.copy(b, LibraryProvider.Dictionary.PND0.file());
|
|
|
|
|
LibraryProvider.activatePND();
|
|
|
|
|