giacomo 01/04/11 23:32:57
Modified: src/org/apache/cocoon/environment/commandline Tag:
xml-cocoon2 CommandLineRequest.java
Log:
implemented some missing methods
Revision Changes Path
No revision
No revision
1.1.2.11 +23 -6
xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/CommandLineRequest.java
Index: CommandLineRequest.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/CommandLineRequest.java,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -r1.1.2.10 -r1.1.2.11
--- CommandLineRequest.java 2001/03/30 17:14:26 1.1.2.10
+++ CommandLineRequest.java 2001/04/12 06:32:56 1.1.2.11
@@ -27,7 +27,7 @@
* Creates a specific servlet request simulation from command line usage.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.1.2.10 $ $Date: 2001/03/30 17:14:26 $
+ * @version CVS $Revision: 1.1.2.11 $ $Date: 2001/04/12 06:32:56 $
*/
/*
@@ -49,6 +49,15 @@
}
}
+ private class EmptyEnumeration implements Enumeration {
+ public boolean hasMoreElements() {
+ return false;
+ }
+ public Object nextElement() {
+ return null;
+ }
+ }
+
private String contextPath;
private String servletPath;
private String pathInfo;
@@ -113,8 +122,12 @@
return (parameters != null) ? new
IteratorWrapper(parameters.keySet().iterator()) : null;
}
public String[] getParameterValues(String name) {
- throw new RuntimeException (this.getClass().getName() +
".getParameterValues(String name) method not yet implemented!");
- } // FIXME
+ Object [] obj = parameters.values().toArray();
+ String [] str = new String [obj.length];
+ for (int i = 0; i < obj.length; i++)
+ str[i] = (String)obj[i];
+ return str;
+ }
public String getHeader(String name) {
return (headers != null) ? (String) headers.get(name) : null;
@@ -127,12 +140,16 @@
//FIXME
//throw new RuntimeException (this.getClass().getName() +
".getDateHeader(String name) method not yet implemented!");
return 0;
- }
+ }
public Enumeration getHeaders(String name) {
- throw new RuntimeException (this.getClass().getName() +
".getHeaders(String name) method not yet implemented!");
+ //throw new RuntimeException (this.getClass().getName() +
".getHeaders(String name) method not yet implemented!");
+ return new EmptyEnumeration();
} // FIXME
public Enumeration getHeaderNames() {
- return (headers != null) ? new
IteratorWrapper(headers.keySet().iterator()) : null;
+ if (headers != null)
+ return new IteratorWrapper(headers.keySet().iterator());
+ else
+ return new EmptyEnumeration();
}
public BufferedReader getReader() throws IOException { return null; }
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]