You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by bw...@apache.org on 2003/05/24 23:47:22 UTC
cvs commit: maven-new/fetch/src/test/java/org/apache/maven/fetch/servlets SlowRepoServlet.java FlawlessRepoServlet.java
bwalding 2003/05/24 14:47:22
Modified: fetch/src/test/java/org/apache/maven/fetch DownloadTest.java
fetch/xdocs features.xml downloads.xml example.xml index.xml
fetch project.xml
fetch/src/test/java/org/apache/maven/fetch/jetty
JettyTestEngine.java
fetch/src/test/java/org/apache/maven/fetch/servlets
FlawlessRepoServlet.java
Added: fetch/src/test/java/org/apache/maven/fetch FlawlessTest.java
fetch/xdocs navigation.xml
fetch/src/main/java/org/apache/maven/fetch/exceptions
FetchException.java TransportFetchException.java
fetch/src/main/java/org/apache/maven/fetch FetchTool.java
FetchRequest.java FetchResponse.java
fetch .cvsignore
fetch/src/test/java/org/apache/maven/fetch/servlets/data
test-data-2.txt
fetch/src/test/java/org/apache/maven/fetch/servlets
SlowRepoServlet.java
Removed: fetch/src/main/java/org/apache/maven/fetch/exceptions
TransportDepException.java DepException.java
fetch/src/main/java/org/apache/maven/fetch DownloadTool.java
DownloadRequest.java DownloadResponse.java
Log:
Cleaned up docs, renamed classes to Fetch*
(If you want me off the island you're going to have to revoke my commit privileges)
Revision Changes Path
1.2 +4 -4 maven-new/fetch/src/test/java/org/apache/maven/fetch/DownloadTest.java
Index: DownloadTest.java
===================================================================
RCS file: /home/cvs/maven-new/fetch/src/test/java/org/apache/maven/fetch/DownloadTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DownloadTest.java 24 May 2003 00:09:51 -0000 1.1
+++ DownloadTest.java 24 May 2003 21:47:21 -0000 1.2
@@ -23,11 +23,11 @@
}
public void testSimple() throws InterruptedException {
- DownloadTool bean = new DownloadTool();
+ FetchTool bean = new FetchTool();
//XXX this should create a jetty install and check files
- DownloadRequest dreq = new DownloadRequest("http://era.health.qld.gov.au/index.html");
- DownloadResponse dresp = bean.performDownload(dreq);
+ FetchRequest dreq = new FetchRequest("http://era.health.qld.gov.au/index.html");
+ FetchResponse dresp = bean.performDownload(dreq);
assertNotNull(dresp);
Thread.sleep(100000);
assertNotNull(dresp.getOutputFile());
1.1 maven-new/fetch/src/test/java/org/apache/maven/fetch/FlawlessTest.java
Index: FlawlessTest.java
===================================================================
/*
* Created on 24/05/2003
*
* To change this generated comment go to
* Window>Preferences>Java>Code Generation>Code Template
*/
package org.apache.maven.fetch;
import junit.framework.TestCase;
/**
* @author <a href="bwalding@jakarta.org">Ben Walding</a>
* @version $Id: FlawlessTest.java,v 1.1 2003/05/24 21:47:21 bwalding Exp $
*/
public class FlawlessTest extends TestCase
{
public void testA() {
}
}
1.2 +1 -1 maven-new/fetch/xdocs/features.xml
Index: features.xml
===================================================================
RCS file: /home/cvs/maven-new/fetch/xdocs/features.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- features.xml 24 May 2003 00:10:25 -0000 1.1
+++ features.xml 24 May 2003 21:47:21 -0000 1.2
@@ -3,7 +3,7 @@
<document>
<properties>
- <title>Dep - Features</title>
+ <title>Features</title>
<author email="bwalding@apache.org">Ben Walding</author>
</properties>
1.2 +1 -1 maven-new/fetch/xdocs/downloads.xml
Index: downloads.xml
===================================================================
RCS file: /home/cvs/maven-new/fetch/xdocs/downloads.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- downloads.xml 24 May 2003 00:10:25 -0000 1.1
+++ downloads.xml 24 May 2003 21:47:21 -0000 1.2
@@ -3,7 +3,7 @@
<document>
<properties>
- <title>Dep - Downloads</title>
+ <title>Downloads</title>
<author email="bwalding@apache.org">Ben Walding</author>
</properties>
1.2 +3 -3 maven-new/fetch/xdocs/example.xml
Index: example.xml
===================================================================
RCS file: /home/cvs/maven-new/fetch/xdocs/example.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- example.xml 24 May 2003 00:10:25 -0000 1.1
+++ example.xml 24 May 2003 21:47:21 -0000 1.2
@@ -3,7 +3,7 @@
<document>
<properties>
- <title>Dep - Features</title>
+ <title>Examples</title>
<author email="bwalding@apache.org">Ben Walding</author>
</properties>
@@ -11,11 +11,11 @@
<section name="Example 1">
<p>
- Create a DownloadRequest
+ Create a FetchRequest
</p>
<source>
- DownloadRequest dreq = new DownloadRequest("http://www.ibiblio.org/maven/commons-digester/jars/commons-digester-1.4.1.jar");
+ FetchRequest dreq = new FetchRequest("http://www.ibiblio.org/maven/commons-digester/jars/commons-digester-1.4.1.jar");
</source>
</section>
1.2 +1 -1 maven-new/fetch/xdocs/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/maven-new/fetch/xdocs/index.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- index.xml 24 May 2003 00:10:25 -0000 1.1
+++ index.xml 24 May 2003 21:47:21 -0000 1.2
@@ -3,7 +3,7 @@
<document>
<properties>
- <title>Dep - Downloads</title>
+ <title>Downloads</title>
<author email="bwalding@apache.org">Ben Walding</author>
</properties>
1.1 maven-new/fetch/xdocs/navigation.xml
Index: navigation.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Fetch">
<title>Fetch</title>
<body>
<menu name="Fetch">
<item name="Overview" href="/index.html"/>
<item name="Features" href="/features.html"/>
<item name="Downloads" href="/downloads.html"/>
<item name="Examples" href="/examples.html"/>
</menu>
</body>
</project>
1.1 maven-new/fetch/src/main/java/org/apache/maven/fetch/exceptions/FetchException.java
Index: FetchException.java
===================================================================
package org.apache.maven.fetch.exceptions;
/**
* @author Ben Walding
* @version $Id: FetchException.java,v 1.1 2003/05/24 21:47:21 bwalding Exp $
*/
public class FetchException extends Exception {
}
1.1 maven-new/fetch/src/main/java/org/apache/maven/fetch/exceptions/TransportFetchException.java
Index: TransportFetchException.java
===================================================================
package org.apache.maven.fetch.exceptions;
/**
* For errors in the underlying transport layer.
* @author Ben Walding
* @version $Id: TransportFetchException.java,v 1.1 2003/05/24 21:47:21 bwalding Exp $
*/
public class TransportFetchException {
}
1.1 maven-new/fetch/src/main/java/org/apache/maven/fetch/FetchTool.java
Index: FetchTool.java
===================================================================
package org.apache.maven.fetch;
/**
* @author Ben Walding
* @version $Id: FetchTool.java,v 1.1 2003/05/24 21:47:22 bwalding Exp $
*/
public class FetchTool {
public FetchResponse performDownload(FetchRequest request) {
return new FetchResponse();
}
}
1.1 maven-new/fetch/src/main/java/org/apache/maven/fetch/FetchRequest.java
Index: FetchRequest.java
===================================================================
package org.apache.maven.fetch;
import java.io.File;
import java.io.OutputStream;
/**
* @author Ben Walding
* @version $Id: FetchRequest.java,v 1.1 2003/05/24 21:47:22 bwalding Exp $
*/
public class FetchRequest
{
private OutputStream outputStream;
private String url;
private File outputDir;
private File outputFile;
private boolean resumeDownload = false;
public FetchRequest(String url)
{
}
private void clearOutput()
{
this.outputFile = null;
this.outputDir = null;
this.outputStream = null;
}
public void setOutputFile(File outputFile)
{
clearOutput();
this.outputFile = outputFile;
}
public void setOutputDir(File outputDir)
{
clearOutput();
this.outputDir = outputDir;
}
public void setOutputStream(OutputStream outputStream)
{
clearOutput();
this.outputStream = outputStream;
}
}
1.1 maven-new/fetch/src/main/java/org/apache/maven/fetch/FetchResponse.java
Index: FetchResponse.java
===================================================================
package org.apache.maven.fetch;
import java.io.File;
/**
* @author Ben Walding
* @version $Id: FetchResponse.java,v 1.1 2003/05/24 21:47:22 bwalding Exp $
*/
public class FetchResponse {
private File outputFile;
/**
* @return
*/
public File getOutputFile() {
return outputFile;
}
/**
* only this package should be able to configure a response?
* @param file
*/
void setOutputFile(File file) {
outputFile = file;
}
}
1.2 +3 -3 maven-new/fetch/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven-new/fetch/project.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- project.xml 24 May 2003 00:06:56 -0000 1.1
+++ project.xml 24 May 2003 21:47:22 -0000 1.2
@@ -9,9 +9,9 @@
<url>http://www.walding.com/</url>
</organization>
<inceptionYear>2003</inceptionYear>
- <package>org.apache.maven.dep</package>
+ <package>org.apache.maven.fetch</package>
- <shortDescription>Lightweight downloader</shortDescription>
+ <shortDescription>Lightweight resource fetcher</shortDescription>
<description>
Dep is an ultra-lightweight dependency downloader
@@ -20,7 +20,7 @@
<url>http://projects.walding.com/dictator/</url>
<siteAddress>atlas.walding.com</siteAddress>
<siteDirectory>
- /var/www/projects.walding.com/html/dep
+ /var/www/projects.walding.com/html/fetch
</siteDirectory>
<distributionDirectory>
</distributionDirectory>
1.1 maven-new/fetch/.cvsignore
Index: .cvsignore
===================================================================
.classpath
target
.project
build.properties
maven.log
velocity.log
1.1 maven-new/fetch/src/test/java/org/apache/maven/fetch/servlets/data/test-data-2.txt
Index: test-data-2.txt
===================================================================
THIS IS TEST-DATA-2.TXT
1.2 +3 -1 maven-new/fetch/src/test/java/org/apache/maven/fetch/jetty/JettyTestEngine.java
Index: JettyTestEngine.java
===================================================================
RCS file: /home/cvs/maven-new/fetch/src/test/java/org/apache/maven/fetch/jetty/JettyTestEngine.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JettyTestEngine.java 24 May 2003 00:09:52 -0000 1.1
+++ JettyTestEngine.java 24 May 2003 21:47:22 -0000 1.2
@@ -1,6 +1,7 @@
package org.apache.maven.fetch.jetty;
import org.apache.maven.fetch.servlets.FlawlessRepoServlet;
+import org.apache.maven.fetch.servlets.SlowRepoServlet;
import org.mortbay.http.HttpContext;
import org.mortbay.http.HttpServer;
import org.mortbay.http.SocketListener;
@@ -36,6 +37,7 @@
// Map a servlet onto the container
servlets.addServlet("/flawless-repo/*", FlawlessRepoServlet.class.getName());
+ servlets.addServlet("/slow-repo/*", SlowRepoServlet.class.getName());
// Serve static content from the context
//String home = System.getProperty("jetty.home", ".");
1.2 +58 -1 maven-new/fetch/src/test/java/org/apache/maven/fetch/servlets/FlawlessRepoServlet.java
Index: FlawlessRepoServlet.java
===================================================================
RCS file: /home/cvs/maven-new/fetch/src/test/java/org/apache/maven/fetch/servlets/FlawlessRepoServlet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FlawlessRepoServlet.java 24 May 2003 00:09:52 -0000 1.1
+++ FlawlessRepoServlet.java 24 May 2003 21:47:22 -0000 1.2
@@ -1,5 +1,61 @@
package org.apache.maven.fetch.servlets;
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2003 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache Maven" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
+ * written permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * "Apache Maven", nor may "Apache" appear in their name, without
+ * prior written permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * ====================================================================
+ */
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -12,6 +68,7 @@
import org.apache.maven.fetch.IOUtility;
/**
+ * Simulates a repository that never fails
* @author Ben Walding
* @version $Id$
*/
1.1 maven-new/fetch/src/test/java/org/apache/maven/fetch/servlets/SlowRepoServlet.java
Index: SlowRepoServlet.java
===================================================================
package org.apache.maven.fetch.servlets;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import javax.servlet.http.HttpServlet;
/**
* This repository works, but it is quite slow to transfer data.
* first half, 5 second delay, last half
*
* This will ensure that readers won't fall apart if they stop getting data temporarily
*
* @author <a href="bwalding@jakarta.org">Ben Walding</a>
* @version $Id: SlowRepoServlet.java,v 1.1 2003/05/24 21:47:22 bwalding Exp $
*/
public class SlowRepoServlet extends HttpServlet
{
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org