[
https://issues.apache.org/jira/browse/NUTCH-2300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15428812#comment-15428812
]
ASF GitHub Bot commented on NUTCH-2300:
---------------------------------------
Github user lewismc commented on a diff in the pull request:
https://github.com/apache/nutch/pull/141#discussion_r75551347
--- Diff:
src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/HttpBase.java
---
@@ -563,23 +558,25 @@ protected static void main(HttpBase http, String[]
args) throws Exception {
protected abstract Response getResponse(URL url, CrawlDatum datum,
boolean followRedirects) throws ProtocolException, IOException;
- public BaseRobotRules getRobotRules(Text url, CrawlDatum datum) {
- return robots.getRobotRulesSet(this, url);
+ @Override
+ public BaseRobotRules getRobotRules(Text url, CrawlDatum datum,
+ List<Content> robotsTxtContent) {
+ return robots.getRobotRulesSet(this, url, robotsTxtContent);
}
/**
* Transforming a String[] into a HashMap for faster searching
* @param input String[]
* @return a new HashMap
*/
- private HashMap arrayToMap(String[]input){
- if (input==null ||input.length==0) {
- return new HashMap();
+ private HashMap<String, String> arrayToMap(String[] input) {
+ if (input == null || input.length == 0) {
+ return new HashMap<String, String>();
}
- HashMap hm=new HashMap();
- for (int i=0;i<input.length;i++){
- if (!"".equals(input[i].trim())){
- hm.put(input[i],input[i]);
+ HashMap<String, String> hm = new HashMap<String, String>();
--- End diff --
Can just use diamond operator on RHS
> Fetcher to optionally save robots.txt
> -------------------------------------
>
> Key: NUTCH-2300
> URL: https://issues.apache.org/jira/browse/NUTCH-2300
> Project: Nutch
> Issue Type: Improvement
> Components: fetcher, protocol, segment
> Reporter: Sebastian Nagel
> Fix For: 1.13
>
>
> For debugging or archival purposes it may be useful to let Fetcher store the
> robots.txt response (content and HTTP status). Of course, this should be
> optional and not by default.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)