You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by ca...@apache.org on 2001/08/28 19:14:32 UTC
cvs commit: jakarta-taglibs/scrape/src/org/apache/taglibs/scrape PageData.java
catlett 01/08/28 10:14:32
Modified: scrape/src/org/apache/taglibs/scrape PageData.java
Log:
made a change in the way the scrape taglib makes it's http connections it should now follow redirects and honor the proxy settings
Revision Changes Path
1.3 +8 -5 jakarta-taglibs/scrape/src/org/apache/taglibs/scrape/PageData.java
Index: PageData.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/scrape/src/org/apache/taglibs/scrape/PageData.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PageData.java 2001/05/21 22:57:49 1.2
+++ PageData.java 2001/08/28 17:14:32 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-taglibs/scrape/src/org/apache/taglibs/scrape/PageData.java,v 1.2 2001/05/21 22:57:49 catlett Exp $
- * $Revision: 1.2 $
- * $Date: 2001/05/21 22:57:49 $
+ * $Header: /home/cvs/jakarta-taglibs/scrape/src/org/apache/taglibs/scrape/PageData.java,v 1.3 2001/08/28 17:14:32 catlett Exp $
+ * $Revision: 1.3 $
+ * $Date: 2001/08/28 17:14:32 $
*
* ====================================================================
*
@@ -425,7 +425,7 @@
*/
class Page extends Thread {
- private HttpConnection connection; // object to create an http request
+ private HttpURLConnection connection; // object to create an http request
private long lastmodified; // time the page was last modified
private long expires; // http header = time the page expires
private URL url; // url from the page to be scraped
@@ -449,7 +449,10 @@
// make http connection to url
try {
// create new HttpUrlConnection
- connection = new HttpConnection(url);
+ //connection = new HttpConnection(url);
+ // change from Kenneth Meltsner bypasses the need for a seperate
+ // HttpURLConnection class
+ connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("HEAD");
connection.connect();