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

The following commit(s) were added to refs/heads/master by this push:
       new  c181953   NUTCH-2193 Upgrade feed parser plugin to use rome 1.5.1
c181953 is described below

commit c1819539ba21a294c1afc12b876b83f74a1ce3e7
Author: Sebastian Nagel <[email protected]>
AuthorDate: Thu Apr 6 15:07:32 2017 +0200

    NUTCH-2193 Upgrade feed parser plugin to use rome 1.5.1
---
 src/plugin/feed/ivy.xml                                    |  5 +++--
 src/plugin/feed/plugin.xml                                 |  5 +++--
 .../src/java/org/apache/nutch/parse/feed/FeedParser.java   | 14 +++++++-------
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/plugin/feed/ivy.xml b/src/plugin/feed/ivy.xml
index c29bd03..02c9539 100644
--- a/src/plugin/feed/ivy.xml
+++ b/src/plugin/feed/ivy.xml
@@ -36,8 +36,9 @@
   </publications>
 
   <dependencies>
-    <dependency org="rome" name="rome" rev="0.9" conf="*->master"/>
-    <dependency org="org.jdom" name="jdom" rev="1.1" conf="*->master"/>
+    <dependency org="com.rometools" name="rome" rev="1.5.1">
+      <exclude name="slf4j-api" />
+    </dependency>
   </dependencies>
   
 </ivy-module>
diff --git a/src/plugin/feed/plugin.xml b/src/plugin/feed/plugin.xml
index 3a68d8d..41109c9 100644
--- a/src/plugin/feed/plugin.xml
+++ b/src/plugin/feed/plugin.xml
@@ -21,8 +21,9 @@
       <library name="feed.jar">
         <export name="*" />
       </library>
-      <library name="rome-0.9.jar" />
-      <library name="jdom-1.1.jar" />
+      <library name="rome-1.5.1.jar" />
+      <library name="rome-utils-1.5.1.jar" />
+      <library name="jdom-2.0.2.jar" />
     </runtime>
     
     <requires>
diff --git 
a/src/plugin/feed/src/java/org/apache/nutch/parse/feed/FeedParser.java 
b/src/plugin/feed/src/java/org/apache/nutch/parse/feed/FeedParser.java
index 0936187..5ec1dcf 100644
--- a/src/plugin/feed/src/java/org/apache/nutch/parse/feed/FeedParser.java
+++ b/src/plugin/feed/src/java/org/apache/nutch/parse/feed/FeedParser.java
@@ -23,7 +23,6 @@ import java.io.DataInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map.Entry;
 
@@ -54,12 +53,12 @@ import org.apache.nutch.util.NutchConfiguration;
 import org.xml.sax.InputSource;
 
 // ROME imports
-import com.sun.syndication.feed.synd.SyndCategory;
-import com.sun.syndication.feed.synd.SyndContent;
-import com.sun.syndication.feed.synd.SyndEntry;
-import com.sun.syndication.feed.synd.SyndFeed;
-import com.sun.syndication.feed.synd.SyndPerson;
-import com.sun.syndication.io.SyndFeedInput;
+import com.rometools.rome.feed.synd.SyndCategory;
+import com.rometools.rome.feed.synd.SyndContent;
+import com.rometools.rome.feed.synd.SyndEntry;
+import com.rometools.rome.feed.synd.SyndFeed;
+import com.rometools.rome.feed.synd.SyndPerson;
+import com.rometools.rome.io.SyndFeedInput;
 
 /**
  * 
@@ -209,6 +208,7 @@ public class FeedParser implements Parser {
     byte[] bytes = new byte[(int) file.length()];
     DataInputStream in = new DataInputStream(new FileInputStream(file));
     in.readFully(bytes);
+    in.close();
     ParseResult parseResult = parser.getParse(new Content(url, url, bytes,
         "application/rss+xml", new Metadata(), conf));
     for (Entry<Text, Parse> entry : parseResult) {

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to