diff --git a/README.md b/README.md index d74c16792..f5f0e847b 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ The (GPLv2+) source code used to build YaCy is distributed with the package (in ## Where is the documentation? - [Homepage](https://yacy.net) -- [International Forum](https://searchlab.eu) +- [International Forum](https://community.searchlab.eu) - [German wiki](https://wiki.yacy.net/index.php/De:Start) - [Esperanto wiki](https://wiki.yacy.net/index.php/Eo:Start) - [French wiki](https://wiki.yacy.net/index.php/Fr:Start) @@ -168,7 +168,7 @@ To start developing YaCy in **IntelliJ IDEA**: - Run via IDE -> Add Configuration -> + -> Gradle -> in Run Tasks add: build run - (in above line "build" is needed to make sure all needed Gradle tasks are executed before run) -To join our development community, got to https://searchlab.eu +To join our development community, got to https://community.searchlab.eu Send pull requests to https://github.com/yacy/yacy_search_server @@ -204,7 +204,7 @@ scripts you can easily create more shell API access methods. ## Contact -[Visit the international YaCy forum](https://searchlab.eu) +[Visit the international YaCy forum](https://community.searchlab.eu) where you can start a discussion there in your own language. Questions and requests for paid customization and integration into enterprise solutions. diff --git a/htroot/Status.html b/htroot/Status.html index 7702787c2..8f550d92e 100644 --- a/htroot/Status.html +++ b/htroot/Status.html @@ -178,7 +178,7 @@ #(hintSupport)#::
idea
-
If you need professional support, please write to support@yacy.net
For community support, please visit our forum. +
If you need professional support, please write to support@yacy.net
For community support, please visit our forum.
#(/hintSupport)# diff --git a/htroot/Steering.html b/htroot/Steering.html index b4fcd83fc..bd2705dbd 100644 --- a/htroot/Steering.html +++ b/htroot/Steering.html @@ -192,7 +192,7 @@ XDtoU7vQ/wIAAP//AwBb7ktEXQ4nqQAAAABJRU5ErkJggg==" width="128" height="64" alt="K

Please send us feed-back about your experience with an
anonymous message
or a
- posting to our web forums
+ posting to our web forums
or a
bug report!

Professional Support

diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template index 5bd7f9f3a..64f4df72c 100644 --- a/htroot/env/templates/header.template +++ b/htroot/env/templates/header.template @@ -105,7 +105,7 @@
  •  
  • -
    +
  • diff --git a/htroot/env/templates/simpleSearchHeader.template b/htroot/env/templates/simpleSearchHeader.template index dcfb2a922..35fdf067c 100644 --- a/htroot/env/templates/simpleSearchHeader.template +++ b/htroot/env/templates/simpleSearchHeader.template @@ -60,7 +60,7 @@
  • JavaScript information
  • external   Download YaCy
  • -
  • external   Community (Web Forums)
  • +
  • external   Community (Web Forums)
  • external   Git Repository
  • external   Bugtracker
  • diff --git a/htroot/env/templates/simpleheader.template b/htroot/env/templates/simpleheader.template index f92b79e5e..3112f4601 100644 --- a/htroot/env/templates/simpleheader.template +++ b/htroot/env/templates/simpleheader.template @@ -40,7 +40,7 @@
  • JavaScript information
  • external   Download YaCy
  • -
  • external   Community (Web Forums)
  • +
  • external   Community (Web Forums)
  • external   Git Repository
  • external   Bugtracker
  • diff --git a/htroot/yacy/ui/yacyui-admin.html b/htroot/yacy/ui/yacyui-admin.html index a7696f6f9..0b8ff4f36 100644 --- a/htroot/yacy/ui/yacyui-admin.html +++ b/htroot/yacy/ui/yacyui-admin.html @@ -135,7 +135,7 @@ $(function() { - + YaCy Forum
    Forum diff --git a/htroot/yacy/ui/yacyui-welcome.html b/htroot/yacy/ui/yacyui-welcome.html index c476f0d17..00dde2ab3 100644 --- a/htroot/yacy/ui/yacyui-welcome.html +++ b/htroot/yacy/ui/yacyui-welcome.html @@ -38,7 +38,7 @@ apfelmaennchen

    Bug Tracker

    diff --git a/locales/de.lng b/locales/de.lng index aeb170039..97ecf4df0 100644 --- a/locales/de.lng +++ b/locales/de.lng @@ -1811,7 +1811,7 @@ deselect the partial import flag==Den teilweisen Import Flag abschalten When an export is started, surrogate files are generated into DATA/SURROGATE/in which are automatically fetched by an indexer thread.==Wenn ein Export gestartet wird werden Hilfsdateien in DATA/SURROGATE/in erzeugt, die automatisch von einem Indexer Thread geholt und verarbeitet werden. All indexed surrogate files are then moved to DATA/SURROGATE/out and can be re-cycled when an index is deleted.==Alle indexierten Hilfsdateien werden dann nach DATA/SURROGATE/out verschoben und können recycelt werden wenn ein Index gelöscht wird. The URL stub==Der Teil der URL -like https://searchlab.eu==wie z.B. https://searchlab.eu +like https://community.searchlab.eu==wie z.B. https://community.searchlab.eu this must be the path right in front of '/viewtopic.php?'==dies muss den kompletten Pfad vor '/viewtopic.php?' enthalten Type==Typ > of database<==> der Datenbank< diff --git a/locales/fr.lng b/locales/fr.lng index 72b9f9f05..8083e8d92 100644 --- a/locales/fr.lng +++ b/locales/fr.lng @@ -2157,7 +2157,7 @@ where it can be retrieved using the URL==d'où elle peut être r&eacu Your Web Page Indexer is idle. You can start your own web crawl here==Votre indexeur de pages web est inactif. Vous pouvez démarrer votre propre balayage du web ici Your Web Page Indexer is busy. You can monitor your web crawl here.==Votre indexeur de pages web est actif. Vous pouvez surveiller votre balayage du web ici. If you need professional support, please write to==Si vous avez besoin d'une assistance professionnelle, vous pouvez écrire à -For community support, please visit our forum==Si vous cherchez l'aide de la communauté, vous pouvez visiter notre forum +For community support, please visit our forum==Si vous cherchez l'aide de la communauté, vous pouvez visiter notre forum "Follow YaCy on Twitter"=="Suivez YaCy sur Twitter" @@ -2302,7 +2302,7 @@ Therefore we like to ask you: do you like YaCy? Will you use it again... if not, Please send us feed-back about your experience with an==Vous pouvez nous faire parvenir vos commentaires avec un anonymous message==message anonyme or a
    ==ou un
    -posting to our web forums
    ==message sur nos forums
    +posting to our web forums
    ==message sur nos forums
    bug report==rapport de bogue

    Professional Support

    ==

    Support professionnel

    If you are a professional user and you would like to use YaCy in your company in combination with consulting services by YaCy specialists, please see==Si vous souhaitez utiliser YaCy dans votre entreprise en association avec un service de consultations d'expertise par des spécialistes de YaCy, veuillez consulter diff --git a/locales/master.lng.xlf b/locales/master.lng.xlf index c836d9d33..1ca931d41 100644 --- a/locales/master.lng.xlf +++ b/locales/master.lng.xlf @@ -2527,7 +2527,7 @@ The URL stub - like https://searchlab.eu + like https://community.searchlab.eu this must be the path right in front of '/viewtopic.php?' diff --git a/locales/ru.lng b/locales/ru.lng index 8aaf55661..d98dbe29e 100644 --- a/locales/ru.lng +++ b/locales/ru.lng @@ -1938,7 +1938,7 @@ deselect the partial import flag==снимите флаг частичного When an export is started, surrogate files are generated into DATA/SURROGATE/in which are automatically fetched by an indexer thread.==После начала экспорта, замещающие файлы создаются в DATA/SURROGATE/in и автоматически добавляются в индексатор. All indexed surrogate files are then moved to DATA/SURROGATE/out and can be re-cycled when an index is deleted.==Все проиндексированные замещающие файлы перемещаются в DATA/SURROGATE/out и могут быть использованы повторно в случае удаления индекса. The URL stub==Часть ссылки -like https://searchlab.eu==например, https://searchlab.eu +like https://community.searchlab.eu==например, https://community.searchlab.eu this must be the path right in front of '/viewtopic.php?'==(путь до '/viewtopic.php?') Type==Тип > of database<==> базы данных< diff --git a/locales/uk.lng b/locales/uk.lng index 276a61e0a..a9164787f 100644 --- a/locales/uk.lng +++ b/locales/uk.lng @@ -1558,7 +1558,7 @@ in phpmyadmin/config.inc.php and place your dump file in /tmp (Otherwise it is n deselect the partial import flag==Зніміть прапорець часткового імпорту When an export is started, surrogate files are generated into DATA/SURROGATE/in which are automatically fetched by an indexer thread.==При запуску експорту в DATA/SURROGATE/in створюються допоміжні файли, які автоматично вилучаються та опрацьовуються потоком індексувача. All indexed surrogate files are then moved to DATA/SURROGATE/out and can be re-cycled when an index is deleted.==Всі проіндексовані допоміжні файли потім переміщуються в DATA/SURROGATE/out, і можуть бути знову оброблені, якщо індекс буде видалено. -The URL stub,
    like https://searchlab.eu==Частина URL, як наприклад,
    https://searchlab.eu +The URL stub,
    like https://community.searchlab.eu==Частина URL, як наприклад,
    https://community.searchlab.eu this must be the path right in front of '/viewtopic.php?'==повний шлях перед "/viewtopic.php?" Type==Тип Host of the database<==Ім’я хосту БД< diff --git a/locales/zh.lng b/locales/zh.lng index 27af5813d..8c9d72777 100644 --- a/locales/zh.lng +++ b/locales/zh.lng @@ -1042,7 +1042,7 @@ deselect the partial import flag==取消部分导入 When an export is started, surrogate files are generated into DATA/SURROGATE/in which are automatically fetched by an indexer thread.==导出过程开始时, 在 DATA/SURROGATE/in 目录下自动生成备份文件, 并且会被索引器自动爬取. All indexed surrogate files are then moved to DATA/SURROGATE/out and can be re-cycled when an index is deleted.==所有被索引的备份文件都在 DATA/SURROGATE/out 目录下, 并被索引器循环利用. The URL stub==URL根域名 -like https://searchlab.eu==比如链接 https://searchlab.eu +like https://community.searchlab.eu==比如链接 https://community.searchlab.eu this must be the path right in front of '/viewtopic.php?'==必须在'/viewtopic.php?'前面 Type==数据库 > of database<==> 类型< diff --git a/startYACY.sh b/startYACY.sh index 712c11c98..fe283000e 100755 --- a/startYACY.sh +++ b/startYACY.sh @@ -250,7 +250,7 @@ else echo "**** USE AT YOUR OWN RISK! Project home and releases: http://yacy.net/ ****" echo "** LOG of YaCy: DATA/LOG/yacy00.log (and yacy.log) **" echo "** STOP YaCy: execute stopYACY.sh and wait some seconds **" - echo "** GET HELP for YaCy: join our community at https://searchlab.eu **" + echo "** GET HELP for YaCy: join our community at https://community.searchlab.eu **" echo "*******************************************************************************" if [ $DEBUG -eq 1 ] #debug then diff --git a/startYACY_debug.bat b/startYACY_debug.bat index 6dc5b6d55..73b705e8c 100644 --- a/startYACY_debug.bat +++ b/startYACY_debug.bat @@ -29,7 +29,7 @@ Echo **** (C) by Michael Peter Christen, usage granted under the GPL Version 2 Echo **** USE AT YOUR OWN RISK! Project home and releases: http://yacy.net/ **** Echo ** LOG of YaCy: DATA/LOG/yacy00.log (and yacy^.log) ** Echo ** STOP YaCy: execute stopYACY.bat and wait some seconds ** -Echo ** GET HELP for YaCy: join our community at https://searchlab.eu ** +Echo ** GET HELP for YaCy: join our community at https://community.searchlab.eu ** Echo ******************************************************************************* Echo ^>^> YaCy started as daemon process. Administration at http://localhost:%port% ^<^< diff --git a/test/java/net/yacy/document/parser/GenericXMLParserTest.java b/test/java/net/yacy/document/parser/GenericXMLParserTest.java index 3d2ae67a3..41115b304 100644 --- a/test/java/net/yacy/document/parser/GenericXMLParserTest.java +++ b/test/java/net/yacy/document/parser/GenericXMLParserTest.java @@ -58,7 +58,7 @@ public class GenericXMLParserTest { @Before public void setUp() { - parser = new GenericXMLParser(); + this.parser = new GenericXMLParser(); } /** @@ -73,11 +73,11 @@ public class GenericXMLParserTest { final String[] fileNames = { "umlaute_dc_xml_iso.xml", "umlaute_dc_xml_utf8.xml" }; final File folder = new File("test" + File.separator + "parsertest" + File.separator); - for (String fileName : fileNames) { - FileInputStream inStream = new FileInputStream(new File(folder, fileName)); - DigestURL location = new DigestURL("http://localhost/" + fileName); + for (final String fileName : fileNames) { + final FileInputStream inStream = new FileInputStream(new File(folder, fileName)); + final DigestURL location = new DigestURL("http://localhost/" + fileName); try { - Document[] documents = parser.parse(location, "text/xml", null, new VocabularyScraper(), 0, + final Document[] documents = this.parser.parse(location, "text/xml", null, new VocabularyScraper(), 0, inStream); assertNotNull("Parser result must not be null for file " + fileName, documents); assertNotNull("Parsed text must not be empty for file " + fileName, documents[0].getTextString()); @@ -107,11 +107,11 @@ public class GenericXMLParserTest { private void testCharsetDetection(final GenericXMLParser parser, final byte[] encodedXML, final String contentTypeHeader, final String expectedCharset, final String expectedConntainedText) throws Exception { - InputStream inStream = new ByteArrayInputStream(encodedXML); - String charsetFromHttpHeader = HeaderFramework.getCharacterEncoding(contentTypeHeader); - DigestURL location = new DigestURL("http://localhost/testfile.xml"); + final InputStream inStream = new ByteArrayInputStream(encodedXML); + final String charsetFromHttpHeader = HeaderFramework.getCharacterEncoding(contentTypeHeader); + final DigestURL location = new DigestURL("http://localhost/testfile.xml"); try { - Document[] documents = parser.parse(location, contentTypeHeader, charsetFromHttpHeader, + final Document[] documents = parser.parse(location, contentTypeHeader, charsetFromHttpHeader, new VocabularyScraper(), 0, inStream); assertEquals(expectedCharset, documents[0].getCharset()); assertNotNull(documents[0].getTextString()); @@ -138,7 +138,7 @@ public class GenericXMLParserTest { */ byte[] encodedXML = ("" + UMLAUT_TEXT_TAG) .getBytes(StandardCharsets.UTF_8); - testCharsetDetection(parser, encodedXML, "application/xml; charset=utf-8", StandardCharsets.UTF_8.name(), + testCharsetDetection(this.parser, encodedXML, "application/xml; charset=utf-8", StandardCharsets.UTF_8.name(), "Maßkrügen"); /* @@ -146,7 +146,7 @@ public class GenericXMLParserTest { * declaration */ encodedXML = ("" + UMLAUT_TEXT_TAG).getBytes(StandardCharsets.UTF_8); - testCharsetDetection(parser, encodedXML, "application/xml; charset=utf-8", StandardCharsets.UTF_8.name(), + testCharsetDetection(this.parser, encodedXML, "application/xml; charset=utf-8", StandardCharsets.UTF_8.name(), "Maßkrügen"); } @@ -169,7 +169,7 @@ public class GenericXMLParserTest { */ byte[] encodedXML = ("" + UMLAUT_TEXT_TAG) .getBytes(StandardCharsets.UTF_16); - testCharsetDetection(parser, encodedXML, "application/xml; charset=utf-16", StandardCharsets.UTF_16.name(), + testCharsetDetection(this.parser, encodedXML, "application/xml; charset=utf-16", StandardCharsets.UTF_16.name(), "Maßkrügen"); /* @@ -177,7 +177,7 @@ public class GenericXMLParserTest { * XML declaration having only BOM (Byte Order Mark) */ encodedXML = ("" + UMLAUT_TEXT_TAG).getBytes(StandardCharsets.UTF_16); - testCharsetDetection(parser, encodedXML, "application/xml; charset=utf-16", + testCharsetDetection(this.parser, encodedXML, "application/xml; charset=utf-16", StandardCharsets.UTF_16BE.name(), "Maßkrügen"); /* @@ -186,14 +186,14 @@ public class GenericXMLParserTest { */ encodedXML = ("" + UMLAUT_TEXT_TAG) .getBytes(StandardCharsets.UTF_16); - testCharsetDetection(parser, encodedXML, "application/xml", StandardCharsets.UTF_16.name(), "Maßkrügen"); + testCharsetDetection(this.parser, encodedXML, "application/xml", StandardCharsets.UTF_16.name(), "Maßkrügen"); /* * Charset is omitted in both Content-Type HTTP header and XML * declaration with BOM (Byte Order Mark) */ encodedXML = ("" + UMLAUT_TEXT_TAG).getBytes(StandardCharsets.UTF_16); - testCharsetDetection(parser, encodedXML, "application/xml", StandardCharsets.UTF_16BE.name(), "Maßkrügen"); + testCharsetDetection(this.parser, encodedXML, "application/xml", StandardCharsets.UTF_16BE.name(), "Maßkrügen"); } /** @@ -211,9 +211,9 @@ public class GenericXMLParserTest { * ISO-8859-1 charset provided only in XML declaration without BOM (Byte * Order Mark) */ - byte[] encodedXML = ("" + UMLAUT_TEXT_TAG) + final byte[] encodedXML = ("" + UMLAUT_TEXT_TAG) .getBytes(StandardCharsets.ISO_8859_1); - testCharsetDetection(parser, encodedXML, "application/xml", StandardCharsets.ISO_8859_1.name(), + testCharsetDetection(this.parser, encodedXML, "application/xml", StandardCharsets.ISO_8859_1.name(), "Maßkrügen"); } @@ -234,7 +234,7 @@ public class GenericXMLParserTest { * XML encoded as UTF-8 without BOM (Byte Order Mark) */ byte[] encodedXML = ("" + UMLAUT_TEXT_TAG).getBytes(StandardCharsets.UTF_8); - testCharsetDetection(parser, encodedXML, "application/xml", StandardCharsets.UTF_8.name(), "Maßkrügen"); + testCharsetDetection(this.parser, encodedXML, "application/xml", StandardCharsets.UTF_8.name(), "Maßkrügen"); /* * XML encoded as ASCII, with non ascii chars encoded as entities @@ -242,7 +242,7 @@ public class GenericXMLParserTest { encodedXML = ("" + "In München steht ein Hofbräuhaus, dort gibt es Bier in Maßkrügen") .getBytes(StandardCharsets.US_ASCII); - testCharsetDetection(parser, encodedXML, "application/xml", StandardCharsets.UTF_8.name(), "Maßkrügen"); + testCharsetDetection(this.parser, encodedXML, "application/xml", StandardCharsets.UTF_8.name(), "Maßkrügen"); } /** @@ -260,9 +260,9 @@ public class GenericXMLParserTest { * UTF-16BE charset provided both in Content-Type HTTP header and in XML * declaration, without BOM (Byte Order Mark) */ - byte[] encodedXML = ("" + UMLAUT_TEXT_TAG) + final byte[] encodedXML = ("" + UMLAUT_TEXT_TAG) .getBytes(StandardCharsets.UTF_16BE); - testCharsetDetection(parser, encodedXML, "application/xml; charset=utf-16be", + testCharsetDetection(this.parser, encodedXML, "application/xml; charset=utf-16be", StandardCharsets.UTF_16BE.name(), "Maßkrügen"); } @@ -279,24 +279,24 @@ public class GenericXMLParserTest { + "" + "" + "" + "XHTML attributes URLs test" + "" + "" - + "Here are YaCyhome page and International Forum." + + "Here are YaCyhome page and International Forum." + "And this is a relative link to a sub document." + "" + ""; - InputStream inStream = new ByteArrayInputStream(xhtml.getBytes(StandardCharsets.UTF_8.name())); + final InputStream inStream = new ByteArrayInputStream(xhtml.getBytes(StandardCharsets.UTF_8.name())); final String contentTypeHeader = "text/xhtml"; - String charsetFromHttpHeader = HeaderFramework.getCharacterEncoding(contentTypeHeader); - DigestURL location = new DigestURL("http://localhost/testfile.xml"); + final String charsetFromHttpHeader = HeaderFramework.getCharacterEncoding(contentTypeHeader); + final DigestURL location = new DigestURL("http://localhost/testfile.xml"); try { - Document[] documents = parser.parse(location, contentTypeHeader, charsetFromHttpHeader, + final Document[] documents = this.parser.parse(location, contentTypeHeader, charsetFromHttpHeader, new VocabularyScraper(), 0, inStream); assertEquals(1, documents.length); - Collection detectedAnchors = documents[0].getAnchors(); + final Collection detectedAnchors = documents[0].getAnchors(); assertNotNull(detectedAnchors); assertEquals(3, detectedAnchors.size()); assertTrue(detectedAnchors.contains(new AnchorURL("http://www.w3.org/1999/xhtml"))); assertTrue(detectedAnchors.contains(new AnchorURL("http://yacy.net"))); - assertTrue(detectedAnchors.contains(new AnchorURL("https://searchlab.eu"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://community.searchlab.eu"))); } finally { inStream.close(); } @@ -316,23 +316,23 @@ public class GenericXMLParserTest { + "" + "XHTML content URLs test" + "" + "" + "Here are some YaCy links:" + "
    " + "
    Home page
    " + "
    http://yacy.net
    " + "
    International Forum
    " - + "
    https://searchlab.eu
    " + "
    " + + "
    https://community.searchlab.eu
    " + "" + "And this is a mention to a relative link : /document.html " + "" + ""; - InputStream inStream = new ByteArrayInputStream(xhtml.getBytes(StandardCharsets.UTF_8.name())); + final InputStream inStream = new ByteArrayInputStream(xhtml.getBytes(StandardCharsets.UTF_8.name())); final String contentTypeHeader = "text/xhtml"; - String charsetFromHttpHeader = HeaderFramework.getCharacterEncoding(contentTypeHeader); - DigestURL location = new DigestURL("http://localhost/testfile.xml"); + final String charsetFromHttpHeader = HeaderFramework.getCharacterEncoding(contentTypeHeader); + final DigestURL location = new DigestURL("http://localhost/testfile.xml"); try { - Document[] documents = parser.parse(location, contentTypeHeader, charsetFromHttpHeader, + final Document[] documents = this.parser.parse(location, contentTypeHeader, charsetFromHttpHeader, new VocabularyScraper(), 0, inStream); assertEquals(1, documents.length); - Collection detectedAnchors = documents[0].getAnchors(); + final Collection detectedAnchors = documents[0].getAnchors(); assertNotNull(detectedAnchors); assertEquals(3, detectedAnchors.size()); assertTrue(detectedAnchors.contains(new AnchorURL("http://www.w3.org/1999/xhtml"))); assertTrue(detectedAnchors.contains(new AnchorURL("http://yacy.net"))); - assertTrue(detectedAnchors.contains(new AnchorURL("https://searchlab.eu"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://community.searchlab.eu"))); } finally { inStream.close(); } @@ -346,12 +346,12 @@ public class GenericXMLParserTest { public void testParseXMLFragment() throws Exception { final String xhtml = "Node content1Node content2"; - InputStream inStream = new ByteArrayInputStream(xhtml.getBytes(StandardCharsets.UTF_8.name())); + final InputStream inStream = new ByteArrayInputStream(xhtml.getBytes(StandardCharsets.UTF_8.name())); final String contentTypeHeader = "text/xml"; - String charsetFromHttpHeader = HeaderFramework.getCharacterEncoding(contentTypeHeader); - DigestURL location = new DigestURL("http://localhost/testfile.xml"); + final String charsetFromHttpHeader = HeaderFramework.getCharacterEncoding(contentTypeHeader); + final DigestURL location = new DigestURL("http://localhost/testfile.xml"); try { - Document[] documents = parser.parse(location, contentTypeHeader, charsetFromHttpHeader, + final Document[] documents = this.parser.parse(location, contentTypeHeader, charsetFromHttpHeader, new VocabularyScraper(), 0, inStream); assertEquals(1, documents.length); assertEquals("Node content1 Node content2", documents[0].getTextString()); @@ -368,13 +368,13 @@ public class GenericXMLParserTest { */ @Test public void testParseWithLimits() throws Exception { - String xhtml = "" + final String xhtml = "" + "" + "" + "" + "" + "XHTML content URLs test" + "" + "" + "

    Here are some YaCy URLs: " + "Home page : http://yacy.net - International Forum : " - + "https://searchlab.eu " + + "https://community.searchlab.eu " + "and this is a mention to a relative URL : /document.html

    " + "

    Here are YaCybug tracker and Wiki." + "And this is a relative link to another sub document

    " @@ -383,21 +383,21 @@ public class GenericXMLParserTest { /* Content within limits */ InputStream inStream = new ByteArrayInputStream(xhtml.getBytes(StandardCharsets.UTF_8.name())); final String contentTypeHeader = "text/xhtml"; - String charsetFromHttpHeader = HeaderFramework.getCharacterEncoding(contentTypeHeader); - DigestURL location = new DigestURL("http://localhost/testfile.xml"); + final String charsetFromHttpHeader = HeaderFramework.getCharacterEncoding(contentTypeHeader); + final DigestURL location = new DigestURL("http://localhost/testfile.xml"); try { - Document[] documents = parser.parseWithLimits(location, contentTypeHeader, charsetFromHttpHeader, new VocabularyScraper(), 0, inStream, Integer.MAX_VALUE, Long.MAX_VALUE); + final Document[] documents = this.parser.parseWithLimits(location, contentTypeHeader, charsetFromHttpHeader, new VocabularyScraper(), 0, inStream, Integer.MAX_VALUE, Long.MAX_VALUE); assertEquals(1, documents.length); assertFalse(documents[0].isPartiallyParsed()); assertTrue(documents[0].getTextString().contains("And this is a relative link")); - Collection detectedAnchors = documents[0].getAnchors(); + final Collection detectedAnchors = documents[0].getAnchors(); assertNotNull(detectedAnchors); assertEquals(5, detectedAnchors.size()); assertTrue(detectedAnchors.contains(new AnchorURL("http://www.w3.org/1999/xhtml"))); assertTrue(detectedAnchors.contains(new AnchorURL("http://yacy.net"))); - assertTrue(detectedAnchors.contains(new AnchorURL("https://searchlab.eu"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://community.searchlab.eu"))); assertTrue(detectedAnchors.contains(new AnchorURL("http://mantis.tokeek.de"))); assertTrue(detectedAnchors.contains(new AnchorURL("https://wiki.yacy.net/index.php/"))); } finally { @@ -407,7 +407,7 @@ public class GenericXMLParserTest { /* Links limit exceeded */ inStream = new ByteArrayInputStream(xhtml.getBytes(StandardCharsets.UTF_8.name())); try { - Document[] documents = parser.parseWithLimits(location, contentTypeHeader, charsetFromHttpHeader, + final Document[] documents = this.parser.parseWithLimits(location, contentTypeHeader, charsetFromHttpHeader, new VocabularyScraper(), 0, inStream, 2, Long.MAX_VALUE); assertEquals(1, documents.length); assertTrue(documents[0].isPartiallyParsed()); @@ -415,7 +415,7 @@ public class GenericXMLParserTest { assertTrue(documents[0].getTextString().contains("Home page")); assertFalse(documents[0].getTextString().contains("And this is a relative link")); - Collection detectedAnchors = documents[0].getAnchors(); + final Collection detectedAnchors = documents[0].getAnchors(); assertNotNull(detectedAnchors); assertEquals(2, detectedAnchors.size()); assertTrue(detectedAnchors.contains(new AnchorURL("http://www.w3.org/1999/xhtml"))); @@ -425,7 +425,7 @@ public class GenericXMLParserTest { } /* Bytes limit exceeded */ - StringBuilder xhtmlBuilder = new StringBuilder("") + final StringBuilder xhtmlBuilder = new StringBuilder("") .append("") .append("") .append("") @@ -434,7 +434,7 @@ public class GenericXMLParserTest { .append("") .append("

    Here are some YaCy URLs: ") .append("Home page : http://yacy.net - International Forum : ") - .append("https://searchlab.eu ") + .append("https://community.searchlab.eu ") .append("and this is a mention to a relative URL : /document.html

    "); /* Add some filler text to reach a total size beyond SAX parser internal input stream buffers */ @@ -442,25 +442,25 @@ public class GenericXMLParserTest { xhtmlBuilder.append("

    Some text to parse

    "); } - int firstBytes = xhtmlBuilder.toString().getBytes(StandardCharsets.UTF_8.name()).length; + final int firstBytes = xhtmlBuilder.toString().getBytes(StandardCharsets.UTF_8.name()).length; xhtmlBuilder.append("

    Here are YaCybug tracker and Wiki.") .append("And this is a relative link to another sub document

    ") .append(""); inStream = new ByteArrayInputStream(xhtmlBuilder.toString().getBytes(StandardCharsets.UTF_8.name())); try { - Document[] documents = parser.parseWithLimits(location, contentTypeHeader, charsetFromHttpHeader, new VocabularyScraper(), 0, inStream, Integer.MAX_VALUE, firstBytes); + final Document[] documents = this.parser.parseWithLimits(location, contentTypeHeader, charsetFromHttpHeader, new VocabularyScraper(), 0, inStream, Integer.MAX_VALUE, firstBytes); assertEquals(1, documents.length); assertTrue(documents[0].isPartiallyParsed()); assertTrue(documents[0].getTextString().contains("and this is a mention to a relative URL")); assertFalse(documents[0].getTextString().contains("And this is a relative link to another")); - Collection detectedAnchors = documents[0].getAnchors(); + final Collection detectedAnchors = documents[0].getAnchors(); assertNotNull(detectedAnchors); assertEquals(3, detectedAnchors.size()); assertTrue(detectedAnchors.contains(new AnchorURL("http://www.w3.org/1999/xhtml"))); assertTrue(detectedAnchors.contains(new AnchorURL("http://yacy.net"))); - assertTrue(detectedAnchors.contains(new AnchorURL("https://searchlab.eu"))); + assertTrue(detectedAnchors.contains(new AnchorURL("https://community.searchlab.eu"))); } finally { inStream.close(); } diff --git a/test/java/net/yacy/document/parser/html/ContentScraperTest.java b/test/java/net/yacy/document/parser/html/ContentScraperTest.java index 105303166..cdb4f3951 100644 --- a/test/java/net/yacy/document/parser/html/ContentScraperTest.java +++ b/test/java/net/yacy/document/parser/html/ContentScraperTest.java @@ -143,13 +143,13 @@ public class ContentScraperTest { @Test public void testGetStartDates() throws MalformedURLException, IOException { List dateResultList; - DigestURL root = new DigestURL("http://test.org/test.html"); + final DigestURL root = new DigestURL("http://test.org/test.html"); - String page = "" + final String page = "" + "" // html5 time tag + ""; - ContentScraper scraper = new ContentScraper(root, 10, new HashSet(), new VocabularyScraper(), 0); + final ContentScraper scraper = new ContentScraper(root, 10, new HashSet(), new VocabularyScraper(), 0); final Writer writer = new TransformerWriter(null, null, scraper, false); FileUtils.copy(new StringReader(page), writer); @@ -157,11 +157,11 @@ public class ContentScraperTest { dateResultList = scraper.getStartDates(); - Calendar cal = Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(0); // to zero hours cal.set(2016, Calendar.DECEMBER, 23); - for (Date d : dateResultList) { + for (final Date d : dateResultList) { Assert.assertEquals(cal.getTime(), d); } scraper.close(); @@ -173,35 +173,35 @@ public class ContentScraperTest { */ @Test public void testFindAbsoluteURLs() throws MalformedURLException { - final String[] urlStrings = { "http://yacy.net", "https://searchlab.eu", "https://en.wikipedia.org" }; + final String[] urlStrings = { "http://yacy.net", "https://community.searchlab.eu", "https://en.wikipedia.org" }; final List urls = new ArrayList<>(); - for (String urlString : urlStrings) { + for (final String urlString : urlStrings) { urls.add(new AnchorURL(urlString)); } /* Test with various white space separators */ - String[] separators = { " ", "\n", "\t", "\r" }; - for (String separator : separators) { - StringBuilder text = new StringBuilder(); - for (String urlString : urlStrings) { + final String[] separators = { " ", "\n", "\t", "\r" }; + for (final String separator : separators) { + final StringBuilder text = new StringBuilder(); + for (final String urlString : urlStrings) { if (text.length() > 0) { text.append(separator); } text.append(urlString); } - Collection detectedURLs = new ArrayList<>(); + final Collection detectedURLs = new ArrayList<>(); ContentScraper.findAbsoluteURLs(text.toString(), detectedURLs, null); Assert.assertEquals(urls.size(), detectedURLs.size()); Assert.assertTrue(urls.containsAll(detectedURLs)); } /* URLs surrounded with parenthesis */ - String[] texts = { "(http://yacy.net)", "YaCy home page (http://yacy.net)", + final String[] texts = { "(http://yacy.net)", "YaCy home page (http://yacy.net)", "Nested parentheses (YaCy home page (http://yacy.net))", "Text in parenthesis (example : http://yacy.net)", "A markdown link [YaCy home page](http://yacy.net)", "A markdown [example](http://yacy.net \"YaCy home page\") inline link" }; - for (String text : texts) { - Collection detectedURLs = new ArrayList<>(); + for (final String text : texts) { + final Collection detectedURLs = new ArrayList<>(); ContentScraper.findAbsoluteURLs(text, detectedURLs, null); Assert.assertEquals(1, detectedURLs.size()); Assert.assertEquals(new AnchorURL("http://yacy.net"), detectedURLs.iterator().next()); @@ -209,11 +209,11 @@ public class ContentScraperTest { /* URLs surrounded with square brackets */ //http://[abcd:ef01:2345:6789:abcd:ef01:2345:6789]/ - String[] squareBracketsTexts = { "[http://yacy.net]", "YaCy home page [http://yacy.net]", + final String[] squareBracketsTexts = { "[http://yacy.net]", "YaCy home page [http://yacy.net]", "Nested brackets [YaCy home page [http://yacy.net]]", "A mediawiki external link with different label [http://yacy.net YaCy home page]" }; - for(String text : squareBracketsTexts) { - Collection detectedURLs = new ArrayList<>(); + for(final String text : squareBracketsTexts) { + final Collection detectedURLs = new ArrayList<>(); ContentScraper.findAbsoluteURLs(text, detectedURLs, null); Assert.assertEquals(1, detectedURLs.size()); Assert.assertEquals(new AnchorURL("http://yacy.net"), detectedURLs.iterator().next()); @@ -221,11 +221,11 @@ public class ContentScraperTest { /* URLs surrounded with curly brackets */ //http://[abcd:ef01:2345:6789:abcd:ef01:2345:6789]/ - String[] curlyBracketsTexts = { "{http://yacy.net}", "YaCy home page {http://yacy.net}", + final String[] curlyBracketsTexts = { "{http://yacy.net}", "YaCy home page {http://yacy.net}", "Nested brackets {YaCy home page {http://yacy.net}}", "Text in brackets {example : http://yacy.net}" }; - for(String text : curlyBracketsTexts) { - Collection detectedURLs = new ArrayList<>(); + for(final String text : curlyBracketsTexts) { + final Collection detectedURLs = new ArrayList<>(); ContentScraper.findAbsoluteURLs(text, detectedURLs, null); Assert.assertEquals(1, detectedURLs.size()); Assert.assertEquals(new AnchorURL("http://yacy.net"), detectedURLs.iterator().next()); @@ -277,7 +277,7 @@ public class ContentScraperTest { */ @Test public void testFindAbsoluteURLsMaxURLs() throws MalformedURLException { - final String text = "Some test URLS : http://yacy.net - https://searchlab.eu - https://en.wikipedia.org"; + final String text = "Some test URLS : http://yacy.net - https://community.searchlab.eu - https://en.wikipedia.org"; /* No limit */ ArrayList detectedURLs = new ArrayList<>(); @@ -425,7 +425,7 @@ public class ContentScraperTest { html2Results.put(html, expectedUrls); for (final Entry html2Result : html2Results.entrySet()) { - ContentScraper scraper = new ContentScraper(docUrl, 10, new HashSet(), new VocabularyScraper(), 0); + final ContentScraper scraper = new ContentScraper(docUrl, 10, new HashSet(), new VocabularyScraper(), 0); try (final Writer writer = new TransformerWriter(null, null, scraper, false)) { FileUtils.copy(new StringReader(html2Result.getKey()), writer); @@ -500,7 +500,7 @@ public class ContentScraperTest { for (final Entry html2Result : html2Results.entrySet()) { - ContentScraper scraper = new ContentScraper(docUrl, 10, new HashSet(), new VocabularyScraper(), 0); + final ContentScraper scraper = new ContentScraper(docUrl, 10, new HashSet(), new VocabularyScraper(), 0); try (final Writer writer = new TransformerWriter(null, null, scraper, false)) { FileUtils.copy(new StringReader(html2Result.getKey()), writer); diff --git a/test/java/net/yacy/document/parser/ooxmlParserTest.java b/test/java/net/yacy/document/parser/ooxmlParserTest.java index f5cf79e47..12d30dee2 100644 --- a/test/java/net/yacy/document/parser/ooxmlParserTest.java +++ b/test/java/net/yacy/document/parser/ooxmlParserTest.java @@ -93,7 +93,7 @@ public class ooxmlParserTest { final String mimetype = testFile[1]; final AnchorURL url = new AnchorURL("http://localhost/" + filename); - AbstractParser p = new ooxmlParser(); + final AbstractParser p = new ooxmlParser(); inStream = new FileInputStream(file); final Document[] docs = p.parse(url, mimetype, null, new VocabularyScraper(), 0, inStream); for (final Document doc : docs) { @@ -116,7 +116,7 @@ public class ooxmlParserTest { if (content != null) { try { content.close(); - } catch (IOException ioe) { + } catch (final IOException ioe) { System.out.println("Could not close text input stream"); } } @@ -126,7 +126,7 @@ public class ooxmlParserTest { if (inStream != null) { try { inStream.close(); - } catch (IOException ioe) { + } catch (final IOException ioe) { System.out.println("Could not close input stream on file " + filename); } } @@ -145,7 +145,7 @@ public class ooxmlParserTest { final String mimetype = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; final AnchorURL url = new AnchorURL("http://localhost/" + fileName); - AbstractParser p = new ooxmlParser(); + final AbstractParser p = new ooxmlParser(); try(InputStream inStream = new FileInputStream(file);) { final Document[] docs = p.parse(url, mimetype, null, new VocabularyScraper(), 0, inStream); assertNotNull("Documents result must not be null", docs); @@ -153,7 +153,7 @@ public class ooxmlParserTest { assertNotNull("Detected URLs must not be null", anchors); assertEquals("2 URLs should be detected", 2, anchors.size()); assertTrue("YaCy home page URL should have been parsed: " + anchors.toString(), anchors.contains(new AnchorURL("http://yacy.net/"))); - assertTrue("YaCy forum URL should have been parsed: " + anchors.toString(), anchors.contains(new AnchorURL("https://searchlab.eu/"))); + assertTrue("YaCy forum URL should have been parsed: " + anchors.toString(), anchors.contains(new AnchorURL("https://community.searchlab.eu/"))); } }