Hi,
I comitted a bug fix in the URLWriter (nested class in
JetspeedDiskCacheEntry) - the HTTP PUT for writing to an URL wasn't working:
First getOutputstream() was called and _afterwards_ the RequestMethod was
set to "PUT" - it needs to be the other way round. Unfortunately the
getOutputstream call is a parameter of the super() call (which needs to be
called first in the constructor) and hence the two statements can't simply
be swapped. I therefore had to move the respective statement into the
getWriter() method. I don't really like it that way but I can't see how the
problem can be solved more cleanly...
ingo.
Index: JetspeedDiskCacheEntry.java
===================================================================
RCS file:
/products/cvs/jetspeed/jetspeed/src/java/org/apache/jetspeed/cache/disk/JetspeedDiskCacheEntry.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- JetspeedDiskCacheEntry.java 2000/11/22 11:10:34 1.16
+++ JetspeedDiskCacheEntry.java 2000/11/23 14:03:56 1.17
<snipp>
public Writer getWriter() throws IOException {
@@ -367,6 +367,8 @@
if(DiskCacheUtils.isLocal( this.getURL() ) )
{
HttpURLConnection conn = (HttpURLConnection) new URL( this.getURL()
).openConnection();
+ conn.setDoOutput(true);
+ conn.setRequestMethod("PUT");
return new URLWriter( conn );
}
<snipp>
public URLWriter( HttpURLConnection conn )
throws UnsupportedEncodingException, IOException
{
- super( conn.getOutputStream(),
- encoding );
+ super( conn.getOutputStream(), encoding );
this.conn = conn;
- this.conn.setRequestMethod("PUT");
- this.conn.setDoOutput(true);
Log.note("URLWriter encoding -> " +
encoding + " method -> " + this.conn.getRequestMethod() );
}
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://marc.theaimsgroup.com/?l=jetspeed>
Problems?: [EMAIL PROTECTED]