You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2004/01/14 09:33:37 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/net WGet.java
michi 2004/01/14 00:33:37
Modified: src/java/org/apache/lenya/net WGet.java
Log:
FIXMEs added
Revision Changes Path
1.28 +7 -28 cocoon-lenya/src/java/org/apache/lenya/net/WGet.java
Index: WGet.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/net/WGet.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- WGet.java 19 Aug 2003 18:47:18 -0000 1.27
+++ WGet.java 14 Jan 2004 08:33:37 -0000 1.28
@@ -1,5 +1,4 @@
/*
-$Id$
<License>
============================================================================
@@ -73,10 +72,10 @@
/**
- * DOCUMENT ME!
+ * Similar to the UNIX wget
*
* @author Michael Wechner
- * @version 0.1
+ * @version $Id$
*/
public class WGet {
static Category log = Category.getInstance(WGet.class);
@@ -225,31 +224,9 @@
return sresponse;
}
- /*
- //FIXME: This is an unfinished attempt at getting the links via cocoon.
- public URL[] getLinksViaCocoon(URL url) throws IOException, HttpException {
- log.debug(".getLinksViaCocoon(): "+url);
-
- java.io.BufferedReader br = null;
- try {
- String linkViewQuery = "cocoon-view=links";
- String sURL = url.getFile();
- URL links = new URL(url, sURL + ((sURL.indexOf("?") == -1) ? "?" : "&") + linkViewQuery);
- java.net.URLConnection links_url_connection = links.openConnection();
- java.io.InputStream is = links_url_connection.getInputStream();
- br = new java.io.BufferedReader(new java.io.InputStreamReader(is));
- String line;
- while ((line = br.readLine()) != null) {
- log.debug(".getLinksViaCocoon(): Link: "+line);
- }
- }
- catch(Exception e){
- log.error(".getLinksViaCocoon(): "+e);
- }
-
- return null;
- }
- */
+ /**
+ *
+ */
public List getLinks(URL url) throws IOException {
log.debug(".getLinks(): Get links from " + url);
@@ -258,6 +235,7 @@
try {
org.apache.lenya.util.HTML html = new org.apache.lenya.util.HTML(url.toString());
links = html.getImageSrcs(false);
+ // FIXME: Get also css links, etc.
} catch (Exception e) {
log.error(".getLinks() Exception 423432: ", e);
}
@@ -284,6 +262,7 @@
String substituteReplacement) throws IOException {
try {
File file = new File(filename);
+ // FIXME: sed should be replaced by some Java component
String command = "/usr/bin/sed --expression=s/" + escapeSlashes(prefixSubstitute) +
"/" + escapeSlashes(substituteReplacement) + "/g " + file.getAbsolutePath();
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org