You are viewing a plain text version of this content. The canonical link for it is here.
Posted to droids-commits@incubator.apache.org by th...@apache.org on 2013/02/11 13:23:55 UTC

svn commit: r1444759 - /incubator/droids/branches/0.2.x-cleanup/droids-crawler/src/main/java/org/apache/droids/crawler/CrawlerTask.java

Author: thorsten
Date: Mon Feb 11 13:23:55 2013
New Revision: 1444759

URL: http://svn.apache.org/r1444759
Log:
Fixing r1444064 which broke the build by removing methods that are now in the contentEntity.

Modified:
    incubator/droids/branches/0.2.x-cleanup/droids-crawler/src/main/java/org/apache/droids/crawler/CrawlerTask.java

Modified: incubator/droids/branches/0.2.x-cleanup/droids-crawler/src/main/java/org/apache/droids/crawler/CrawlerTask.java
URL: http://svn.apache.org/viewvc/incubator/droids/branches/0.2.x-cleanup/droids-crawler/src/main/java/org/apache/droids/crawler/CrawlerTask.java?rev=1444759&r1=1444758&r2=1444759&view=diff
==============================================================================
--- incubator/droids/branches/0.2.x-cleanup/droids-crawler/src/main/java/org/apache/droids/crawler/CrawlerTask.java (original)
+++ incubator/droids/branches/0.2.x-cleanup/droids-crawler/src/main/java/org/apache/droids/crawler/CrawlerTask.java Mon Feb 11 13:23:55 2013
@@ -38,9 +38,7 @@ public class CrawlerTask implements Link
     private final int depth;
     private final URI uri;
     private final LinkedTask from;
-    private Collection<URI> linksTo;
-    private String anchorText;
-    private int weight;
+    private Collection<LinkedTask> linksTo;
     private boolean aborted = false;
 
     /**
@@ -72,29 +70,12 @@ public class CrawlerTask implements Link
      * @param from Link
      * @param uri URI
      * @param depth int
-     * @param weight int
-     */
-    public CrawlerTask(LinkedTask from, URI uri, int depth, int weight) {
-        this.from = from;
-        this.uri = uri;
-        this.depth = depth;
-        this.started = new Date();
-        this.weight = weight;
-        this.contentEntity = new ContentEntity();
-    }
-
-    /**
-     * Creates a new LinkTask.
-     *
-     * @param from Link
-     * @param uri URI
-     * @param depth int
      * @param anchorText String
      */
     public CrawlerTask(LinkedTask from, URI uri, int depth, String anchorText) {
         this(from, uri, depth);
-        this.anchorText = anchorText;
         this.contentEntity = new ContentEntity();
+        this.contentEntity.setAnchorText(anchorText);
     }
 
     @Override
@@ -122,6 +103,7 @@ public class CrawlerTask implements Link
         return aborted;
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public Task createTask(URI uri) {
         return new CrawlerTask(this, uri, this.getDepth() + 1);
@@ -142,7 +124,7 @@ public class CrawlerTask implements Link
     }
 
     @Override
-    public Collection<URI> getTo() {
+    public Collection<LinkedTask> getTo() {
         return linksTo;
     }
 
@@ -151,22 +133,8 @@ public class CrawlerTask implements Link
      *
      * @param linksTo Collection<URI>
      */
-    public void setLinksTo(Collection<URI> linksTo) {
+    public void setLinksTo(Collection<LinkedTask> linksTo) {
         this.linksTo = linksTo;
     }
 
-    @Override
-    public String getAnchorText() {
-        return anchorText;
-    }
-
-    /**
-     * Set the anchor text for this link.
-     *
-     * @param anchorText String
-     */
-    public void setAnchorText(String anchorText) {
-        this.anchorText = anchorText;
-    }
-
 }
\ No newline at end of file