remm 01/02/08 23:48:20
Modified: src/webdav/client/src/org/apache/webdav/lib
WebdavClient.java
Log:
- Use reflection for the shutdownOutput call.
Revision Changes Path
1.20 +15 -5
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavClient.java
Index: WebdavClient.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavClient.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- WebdavClient.java 2001/02/06 05:54:14 1.19
+++ WebdavClient.java 2001/02/09 07:48:19 1.20
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavClient.java,v
1.19 2001/02/06 05:54:14 remm Exp $
- * $Revision: 1.19 $
- * $Date: 2001/02/06 05:54:14 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavClient.java,v
1.20 2001/02/09 07:48:19 remm Exp $
+ * $Revision: 1.20 $
+ * $Date: 2001/02/09 07:48:19 $
*
* ====================================================================
*
@@ -73,6 +73,7 @@
import java.net.Socket;
import java.net.UnknownHostException;
import java.net.URL;
+import java.lang.reflect.Method;
import org.apache.webdav.lib.methods.WebdavMethod;
/**
@@ -278,8 +279,17 @@
sendRequest(method);
boolean closeOutput = needToCloseOutput();
- if (closeOutput)
- socket.shutdownOutput();
+ if (closeOutput) {
+ try {
+ Class[] paramsClasses = new Class[0];
+ Method shutdownOutput = socket.getClass().getMethod
+ ("shutdownOutput", paramsClasses);
+ Object[] params = new Object[0];
+ shutdownOutput.invoke(socket, params);
+ } catch (Exception e) {
+ // Ignore, and hope everything goes right
+ }
+ }
// Parsing response