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/01/20 20:59:39 UTC
cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method OptionsMethod.java WebdavMethod.java
remm 01/01/20 11:59:39
Modified: src/webdav/server/org/apache/slide/webdav/method
OptionsMethod.java WebdavMethod.java
Log:
- Reindent and remove some dead code.
- Add a MS specific header in OPTIONS response, which could improve
compatibility with older MS clients.
Revision Changes Path
1.3 +6 -3 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java
Index: OptionsMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- OptionsMethod.java 2000/11/25 01:36:11 1.2
+++ OptionsMethod.java 2001/01/20 19:59:39 1.3
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v 1.2 2000/11/25 01:36:11 remm Exp $
- * $Revision: 1.2 $
- * $Date: 2000/11/25 01:36:11 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v 1.3 2001/01/20 19:59:39 remm Exp $
+ * $Revision: 1.3 $
+ * $Date: 2001/01/20 19:59:39 $
*
* ====================================================================
*
@@ -129,6 +129,9 @@
}
resp.addHeader("Allow", methodsAllowed);
+
+ resp.addHeader("MS-Author-Via", "DAV");
+
}
}
1.6 +40 -44 jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/WebdavMethod.java
Index: WebdavMethod.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/WebdavMethod.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- WebdavMethod.java 2001/01/17 16:49:04 1.5
+++ WebdavMethod.java 2001/01/20 19:59:39 1.6
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/WebdavMethod.java,v 1.5 2001/01/17 16:49:04 juergen Exp $
- * $Revision: 1.5 $
- * $Date: 2001/01/17 16:49:04 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/WebdavMethod.java,v 1.6 2001/01/20 19:59:39 remm Exp $
+ * $Revision: 1.6 $
+ * $Date: 2001/01/20 19:59:39 $
*
* ====================================================================
*
@@ -311,40 +311,35 @@
*/
public void run()
throws WebdavException {
-
- boolean transactionIsStarted = false;
-
- try {
- parseRequest();
- if (methodNeedsTransactionSupport()) {
- token.begin();
- transactionIsStarted = true;
- }
- executeRequest();
- if (methodNeedsTransactionSupport()) {
- token.commit();
- transactionIsStarted = false;
- }
- } catch (WebdavException ex) {
- throw ex;
- } catch (Exception ex) {
- throw new WebdavException(WebdavStatus.SC_METHOD_FAILURE);
- } finally {
- if (transactionIsStarted && methodNeedsTransactionSupport()) {
- // something went wrong, we are here and the TA is still open
- try {token.rollback();}
- catch (Exception e) { e.printStackTrace(); }
- }
- }
-
-
-
- /*
- if (isMsProprietarySupport()) {
- resp.setHeader("Server", "Microsoft-IIS/5.0");
- }
- */
+ boolean transactionIsStarted = false;
+
+ try {
+ parseRequest();
+ if (methodNeedsTransactionSupport()) {
+ token.begin();
+ transactionIsStarted = true;
+ }
+ executeRequest();
+ if (methodNeedsTransactionSupport()) {
+ token.commit();
+ transactionIsStarted = false;
+ }
+ } catch (WebdavException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new WebdavException(WebdavStatus.SC_METHOD_FAILURE);
+ } finally {
+ if (transactionIsStarted && methodNeedsTransactionSupport()) {
+ // something went wrong, we are here and the TA is still open
+ try {
+ token.rollback();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
}
@@ -353,14 +348,15 @@
/**
* Return true if the method needs transaction support.
- * Return true if the method needs transaction support, e.g.
- * the methods put, proppatch would need TA support. The
- * methods get, propfind would not need transaction support.
- */
- protected boolean methodNeedsTransactionSupport() {
- return true; // this method should return false and e.g. PutMethod should
- // overwrite it to true, but PropFind creates a RevisionDescriptors
- // on the fly
+ * Return true if the method needs transaction support, e.g.
+ * the methods put, proppatch would need TA support. The
+ * methods get, propfind would not need transaction support.
+ */
+ protected boolean methodNeedsTransactionSupport() {
+ return true;
+ // this method should return false and e.g. PutMethod should
+ // overwrite it to true, but PropFind creates a RevisionDescriptors
+ // on the fly
}