*) tested string will appear in input box now (when testing a similar URL it does need to be copied anymore, it can be edited it right away)

*) https:// and ftp:// can be used as start of the string to be tested now too
*) better error handling (no text in Java anymore)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6347 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 16 years ago
parent 3faa011e3d
commit 2d01411bbc

@ -14,10 +14,11 @@
<fieldset>
<legend>Test list:</legend>
<form action="BlacklistTest_p.html" method="post" enctype="multipart/form-data">
<input type="text" name="testurl" size="50" value="http://" />&nbsp;
<input type="text" name="testurl" size="50" value="#[url]#" />&nbsp;
<input type="submit" name="testList" value="Test" />
#(testlist)#::
<br /><br />
<div>
The tested URL was #[url]#<br>
It is blocked for the following cases:<br>
@ -30,6 +31,9 @@
#(listedinsurftips)#::<li>Surftips</li>#(/listedinsurftips)#
</ul>
</div>
::
<br /><br />
<div>The tested URL was not valid.</div>
#(/testlist)#
</form>
</fieldset>

@ -55,12 +55,16 @@ public class BlacklistTest_p {
if(post != null && post.containsKey("testList")) {
prop.put("testlist", "1");
String urlstring = post.get("testurl", "");
if(!urlstring.startsWith("http://")) urlstring = "http://"+urlstring;
if(!urlstring.startsWith("http://") &&
!urlstring.startsWith("https://")&&
!urlstring.startsWith("ftp://")
) urlstring = "http://"+urlstring;
yacyURL testurl = null;
try {
testurl = new yacyURL(urlstring, null);
} catch (final MalformedURLException e) { testurl = null; }
if(testurl != null) {
prop.putHTML("url",testurl.toString());
prop.putHTML("testlist_url",testurl.toString());
if(Switchboard.urlBlacklist.isListed(Blacklist.BLACKLIST_CRAWLER, testurl))
prop.put("testlist_listedincrawler", "1");
@ -75,7 +79,12 @@ public class BlacklistTest_p {
if(Switchboard.urlBlacklist.isListed(Blacklist.BLACKLIST_SURFTIPS, testurl))
prop.put("testlist_listedinsurftips", "1");
}
else prop.put("testlist_url","not valid");
else {
prop.putHTML("url",urlstring);
prop.put("testlist", "2");
}
} else {
prop.putHTML("url", "http://");
}
return prop;
}

Loading…
Cancel
Save