You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by sn...@apache.org on 2017/05/19 10:50:33 UTC

[nutch] branch master updated (b5fd910 -> db77f19)

This is an automated email from the ASF dual-hosted git repository.

snagel pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nutch.git.

      from  b5fd910   Merge pull request #175 from jorgelbg/NUTCH-2353
      adds  af9d7a3   NUTCH-2376 Improve configurability of HTTP Accept* header fields - Accept, Accept-Language and Accept-Charset are configured and used the   same way for both protocol-http and protocol-httpclient - a space as value will unset these header fields (not sent in request)
       new  0312bae   Fix for NUTCH-2353 contributed by jorgelbg
       new  db77f19   Merge branch 'sebastian-nagel-NUTCH-2376-http-accept-header'

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 conf/nutch-default.xml                             | 14 ++++++-
 .../apache/nutch/protocol/http/api/HttpBase.java   | 13 ++++++-
 .../apache/nutch/protocol/http/HttpResponse.java   | 44 +++++++++++++---------
 .../org/apache/nutch/protocol/httpclient/Http.java | 19 +++++-----
 4 files changed, 61 insertions(+), 29 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@nutch.apache.org" <co...@nutch.apache.org>'].

[nutch] 02/02: Merge branch 'sebastian-nagel-NUTCH-2376-http-accept-header'

Posted by sn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

snagel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nutch.git

commit db77f1965b6b6871db91beba338b5bf540ffed4e
Merge: b5fd910 0312bae
Author: Sebastian Nagel <sn...@apache.org>
AuthorDate: Fri May 19 12:49:57 2017 +0200

    Merge branch 'sebastian-nagel-NUTCH-2376-http-accept-header'

 conf/nutch-default.xml                             | 14 ++++++-
 .../apache/nutch/protocol/http/api/HttpBase.java   | 13 ++++++-
 .../apache/nutch/protocol/http/HttpResponse.java   | 44 +++++++++++++---------
 .../org/apache/nutch/protocol/httpclient/Http.java | 19 +++++-----
 4 files changed, 61 insertions(+), 29 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@nutch.apache.org" <co...@nutch.apache.org>.

[nutch] 01/02: Fix for NUTCH-2353 contributed by jorgelbg

Posted by sn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

snagel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nutch.git

commit 0312bae38c9e95d496336dc24133b15ebefd4d3c
Author: Jorge Luis Betancourt <jl...@uci.cu>
AuthorDate: Fri Jan 20 16:13:45 2017 -0500

    Fix for NUTCH-2353 contributed by jorgelbg
---
 src/java/org/apache/nutch/service/model/request/SeedUrl.java  |  8 ++++++++
 src/java/org/apache/nutch/service/resources/SeedResource.java | 11 +++++++++++
 src/java/org/apache/nutch/webui/model/SeedUrl.java            |  9 +++++++++
 3 files changed, 28 insertions(+)

diff --git a/src/java/org/apache/nutch/service/model/request/SeedUrl.java b/src/java/org/apache/nutch/service/model/request/SeedUrl.java
index b1c93a8..14b8e35 100644
--- a/src/java/org/apache/nutch/service/model/request/SeedUrl.java
+++ b/src/java/org/apache/nutch/service/model/request/SeedUrl.java
@@ -17,6 +17,8 @@
 package org.apache.nutch.service.model.request;
 
 import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
 
 import com.fasterxml.jackson.annotation.JsonBackReference;
 import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -30,6 +32,8 @@ public class SeedUrl implements Serializable {
 
   private String url;
 
+  private Map<String, String> metadata = new HashMap<>();
+
   public SeedUrl() {}
 
   public SeedUrl(String url) {
@@ -52,6 +56,10 @@ public class SeedUrl implements Serializable {
     this.url = url;
   }
 
+  public Map<String,String> getMetadata() { return metadata; }
+
+  public void setMetadata(Map<String,String> metadata) { this.metadata = metadata; }
+
   @JsonIgnore
   public SeedList getSeedList() {
     return seedList;
diff --git a/src/java/org/apache/nutch/service/resources/SeedResource.java b/src/java/org/apache/nutch/service/resources/SeedResource.java
index e8a5be3..180c033 100644
--- a/src/java/org/apache/nutch/service/resources/SeedResource.java
+++ b/src/java/org/apache/nutch/service/resources/SeedResource.java
@@ -19,6 +19,7 @@ package org.apache.nutch.service.resources;
 import java.io.OutputStream;
 import java.lang.invoke.MethodHandles;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.Map;
 
 import javax.ws.rs.Consumes;
@@ -105,6 +106,16 @@ public class SeedResource extends AbstractResource {
     if (CollectionUtils.isNotEmpty(seedUrls)) {
       for (SeedUrl seedUrl : seedUrls) {
         os.write(seedUrl.getUrl().getBytes());
+
+        Map<String,String> metadata = seedUrl.getMetadata();
+        Iterator<String> keyIterator = metadata.keySet().iterator();
+
+        while (keyIterator.hasNext()) {
+          String key = keyIterator.next();
+
+          os.write(String.format("\t%s=%s", key, metadata.get(key)).getBytes());
+        }
+
         os.write("\n".getBytes());
       }
     }
diff --git a/src/java/org/apache/nutch/webui/model/SeedUrl.java b/src/java/org/apache/nutch/webui/model/SeedUrl.java
index 5f89241..40b105b 100644
--- a/src/java/org/apache/nutch/webui/model/SeedUrl.java
+++ b/src/java/org/apache/nutch/webui/model/SeedUrl.java
@@ -17,6 +17,8 @@
 package org.apache.nutch.webui.model;
 
 import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -43,6 +45,9 @@ public class SeedUrl implements Serializable {
   @Column
   private String url;
 
+  @Column
+  private Map<String, String> metadata = new HashMap<>();
+
   public Long getId() {
     return id;
   }
@@ -59,6 +64,10 @@ public class SeedUrl implements Serializable {
     this.url = url;
   }
 
+  public Map<String,String> getMetadata() { return metadata; }
+
+  public void setMetadata(Map<String,String> metadata) { this.metadata = metadata; }
+
   @JsonIgnore
   public SeedList getSeedList() {
     return seedList;

-- 
To stop receiving notification emails like this one, please contact
"commits@nutch.apache.org" <co...@nutch.apache.org>.