You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by re...@apache.org on 2001/04/18 23:35:54 UTC
cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/lib ConnectionInterceptor.java WebdavClient.java
remm 01/04/18 14:35:54
Modified: src/webdav/client/src/org/apache/webdav/lib
ConnectionInterceptor.java WebdavClient.java
Log:
- Simplify the hooks in ConnectionInterceptor.
- Call all the connection hooks when a connection event occurs (connect,
disconnect, error, redirect, etc).
Revision Changes Path
1.3 +6 -8 jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/ConnectionInterceptor.java
Index: ConnectionInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/ConnectionInterceptor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ConnectionInterceptor.java 2001/04/18 18:07:31 1.2
+++ ConnectionInterceptor.java 2001/04/18 21:35:53 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/ConnectionInterceptor.java,v 1.2 2001/04/18 18:07:31 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2001/04/18 18:07:31 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/ConnectionInterceptor.java,v 1.3 2001/04/18 21:35:53 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2001/04/18 21:35:53 $
*
* ====================================================================
*
@@ -115,8 +115,7 @@
* @param requestLine Request line sent
* @param headers Headers sent
*/
- public void sentRequest(String method, String uri, String protocol,
- Hashtable headers);
+ public void sentRequest();
/**
@@ -125,8 +124,7 @@
* @param responseLine Response line recieved
* @param headers Headers recieved
*/
- public void recievedResponse(String protocol, int status,
- String statusText, Hashtable headers);
+ public void recievedResponse();
/**
@@ -138,7 +136,7 @@
/**
* Authenticate.
*/
- public void authenticate(String scheme);
+ public void authenticate();
}
1.39 +18 -3 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.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- WebdavClient.java 2001/04/18 21:05:41 1.38
+++ WebdavClient.java 2001/04/18 21:35:53 1.39
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavClient.java,v 1.38 2001/04/18 21:05:41 remm Exp $
- * $Revision: 1.38 $
- * $Date: 2001/04/18 21:05:41 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavClient.java,v 1.39 2001/04/18 21:35:53 remm Exp $
+ * $Revision: 1.39 $
+ * $Date: 2001/04/18 21:35:53 $
*
* ====================================================================
*
@@ -337,6 +337,10 @@
sentRequestBody = true;
}
+ if (connectionInterceptor != null) {
+ connectionInterceptor.sentRequest();
+ }
+
boolean closeOutput = needToCloseOutput();
if (closeOutput) {
try {
@@ -365,6 +369,9 @@
if (method.getStatusCode() == WebdavStatus.SC_CONTINUE) {
if (!sentRequestBody) {
+ if (connectionInterceptor != null) {
+ connectionInterceptor.recievedExpectation();
+ }
sendRequestBody(method, query);
sentRequestBody = true;
}
@@ -380,6 +387,10 @@
}
+ if (connectionInterceptor != null) {
+ connectionInterceptor.recievedResponse();
+ }
+
// Retrieve the authenticate challenge, if any
// (needed in case of a digest challenge, for which the
// header is not constant)
@@ -388,7 +399,11 @@
if (authenticateChallenge != null) {
state.setAuthenticateToken
(authenticateChallenge.getValue());
+ if (connectionInterceptor != null) {
+ connectionInterceptor.authenticate();
+ }
}
+
if ((method.getStatusCode()
== WebdavStatus.SC_MOVED_TEMPORARILY)
|| (method.getStatusCode()