Mailing List Archive

cvs commit: jakarta-lucene-sandbox/contributions/webcrawler-LARM/src/de/lanlab/larm/util WebDocument.java
cmarschner 2002/10/22 08:38:50

Modified: contributions/webcrawler-LARM/src/de/lanlab/larm/util
WebDocument.java
Log:
added copy constructor for URLMessages; added some setter/getter methods

Revision Changes Path
1.6 +44 -3 jakarta-lucene-sandbox/contributions/webcrawler-LARM/src/de/lanlab/larm/util/WebDocument.java

Index: WebDocument.java
===================================================================
RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/webcrawler-LARM/src/de/lanlab/larm/util/WebDocument.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- WebDocument.java 18 Jun 2002 00:46:35 -0000 1.5
+++ WebDocument.java 22 Oct 2002 15:38:50 -0000 1.6
@@ -61,6 +61,7 @@
import java.util.Set;
import de.lanlab.larm.fetcher.URLMessage;
import de.lanlab.larm.net.HostManager;
+import de.lanlab.larm.net.*;

/**
* a web document of whatever type. generated by a fetcher task
@@ -74,10 +75,23 @@
protected String title;
protected Date lastModified;
HashMap fields;
+ boolean isModified;

- public WebDocument(URL url, String mimeType, int resultCode, URL referer, int size, String title, Date lastModified, HostManager hm)
+ public WebDocument(URLMessage msg)
{
- super(url, referer, false, null, hm);
+ super(msg);
+ this.mimeType = "";
+ this.resultCode = -1;
+ this.size = -1;
+ this.title = "";
+ this.lastModified = new Date();
+ clearFields();
+ this.isModified = true;
+ }
+
+ public WebDocument(URL url, String mimeType, int resultCode, URL referer, int size, String title, Date lastModified, HostResolver hm)
+ {
+ super(url, referer, URLMessage.LINKTYPE_ANCHOR, null, hm);
this.url = url;
this.mimeType = mimeType;
//this.document = document;
@@ -85,7 +99,23 @@
this.size = size;
this.title = title;
this.lastModified = lastModified;
- this.fields = new HashMap(7); // expect ~4 fields
+ clearFields();
+ this.isModified = true;
+ }
+
+ public void setModified(boolean modified)
+ {
+ this.isModified = modified;
+ }
+
+ public boolean isModified()
+ {
+ return isModified;
+ }
+
+ public void clearFields()
+ {
+ this.fields = new HashMap(7);
}

public Set getFieldNames()
@@ -119,6 +149,11 @@
return lastModified;
}

+ public void setLastModified(Date lastModified)
+ {
+ this.lastModified = lastModified;
+ }
+
public String getTitle()
{
return title;
@@ -172,6 +207,12 @@
{
this.mimeType = mimeType;
}
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+

public String getMimeType()
{




--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>