juergen 2002/06/27 03:49:59
Modified: src/webdav/server/org/apache/slide/webdav/method
AclMethod.java CheckinMethod.java
CheckoutMethod.java LabelMethod.java
LockMethod.java OptionsMethod.java
PropPatchMethod.java VersionControlMethod.java
Log:
Removed escaping of '<' and '>' in the messges of the exceptions thrown in
parseRequest().
(ralf)
Revision Changes Path
1.24 +10 -10
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AclMethod.java
Index: AclMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AclMethod.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- AclMethod.java 14 Jun 2002 12:24:05 -0000 1.23
+++ AclMethod.java 27 Jun 2002 10:49:58 -0000 1.24
@@ -186,8 +186,8 @@
// Get the root element of the document
Element acl = document.getRootElement();
if ( (acl == null) || ( ! E_ACL.equals(acl.getName()) ) ) {
- throw new JDOMException("Request content document must start with
an <"+
- E_ACL+"> element");
+ throw new JDOMException("Request content document must start with
an <"+
+ E_ACL+"> element");
}
List aceList = acl.getChildren(E_ACE,
NamespaceCache.DEFAULT_NAMESPACE);
@@ -217,13 +217,13 @@
if (protectedCount == 1)
continue;
if (protectedCount > 1) {
- throw new JDOMException("Element <"+E_ACE+"> must contain
at most one <"+E_PROTECTED+"> element");
+ throw new JDOMException("Element <"+E_ACE+"> must contain at
most one <"+E_PROTECTED+"> element");
}
List principalList = ace.getChildren(E_PRINCIPAL,
NamespaceCache.DEFAULT_NAMESPACE);
if (principalList.size() != 1) {
- throw new JDOMException("Element <"+E_ACE+"> must contain
a <"+E_PRINCIPAL+"> element");
+ throw new JDOMException("Element <"+E_ACE+"> must contain a
<"+E_PRINCIPAL+"> element");
}
Element principalElement = (Element) principalList.get(0);
@@ -236,9 +236,9 @@
// there must be only ONE grant or deny element
if ((grantList.size()+denyList.size())!=1) {
- throw new JDOMException("Element <"+E_ACE+"> must contain
either a <"+
- E_GRANT+"> or a <"+
- E_DENY+"> element");
+ throw new JDOMException("Element <"+E_ACE+"> must contain
either a <"+
+ E_GRANT+"> or a <"+
+ E_DENY+"> element");
}
boolean negative = (denyList.size() > 0);
1.11 +4 -4
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckinMethod.java
Index: CheckinMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckinMethod.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- CheckinMethod.java 21 Jun 2002 08:09:11 -0000 1.10
+++ CheckinMethod.java 27 Jun 2002 10:49:58 -0000 1.11
@@ -131,7 +131,7 @@
Element cie = parseRequestContent().getRootElement();
if( cie == null || !cie.getName().equals(E_CHECKIN) ) {
Domain.warn( "Root element must be "+E_CHECKIN );
- throw new JDOMException("Root element must be
<"+E_CHECKIN+">");
+ throw new JDOMException("Root element must be <"+E_CHECKIN+">");
}
Iterator i = cie.getChildren().iterator();
while( i.hasNext() ) {
1.13 +4 -4
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java
Index: CheckoutMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/CheckoutMethod.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- CheckoutMethod.java 21 Jun 2002 08:09:11 -0000 1.12
+++ CheckoutMethod.java 27 Jun 2002 10:49:58 -0000 1.13
@@ -169,7 +169,7 @@
Element coe = parseRequestContent().getRootElement();
if( coe == null || !coe.getName().equals(E_CHECKOUT) ) {
Domain.warn( "Root element must be "+E_CHECKOUT );
- throw new JDOMException("Root element must be
<"+E_CHECKOUT+">");
+ throw new JDOMException("Root element must be
<"+E_CHECKOUT+">");
}
Iterator i = coe.getChildren().iterator();
while( i.hasNext() ) {
1.11 +7 -7
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LabelMethod.java
Index: LabelMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LabelMethod.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- LabelMethod.java 21 Jun 2002 08:09:11 -0000 1.10
+++ LabelMethod.java 27 Jun 2002 10:49:58 -0000 1.11
@@ -132,15 +132,15 @@
* String constant for <code>"Request content must start with a <label>
* element</code>.
*/
- public static final String MUST_START_WITH_LABEL = "Request content must start
with a <"+E_LABEL+"> element";
+ public static final String MUST_START_WITH_LABEL = "Request content must start
with a <"+E_LABEL+"> element";
/**
* String constant for <code>Request content <label> element must
* contain either <add>, <set> or <remove></code>.
*/
public static final String LABEL_MUST_CONTAIN_EITHER_ADD_SET_OR_REMOVE =
- "Request content <label> element must contain either <" +
- E_ADD + ">, <" + E_SET + "> or <" + E_REMOVE + ">";
+ "Request content <label> element must contain either <" +
+ E_ADD + ">, <" + E_SET + "> or <" + E_REMOVE + ">";
1.39 +10 -10
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java
Index: LockMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- LockMethod.java 14 Jun 2002 12:24:05 -0000 1.38
+++ LockMethod.java 27 Jun 2002 10:49:58 -0000 1.39
@@ -301,7 +301,7 @@
Element lockInfoElement = document.getRootElement();
if ( (lockInfoElement == null) ||
( ! E_LOCKINFO.equals(lockInfoElement.getName()) ) ) {
- throw new JDOMException("Request must start with
<"+E_LOCKINFO+"> element");
+ throw new JDOMException("Request must start with <"+E_LOCKINFO+">
element");
}
StringWriter strWriter = null;
@@ -356,12 +356,12 @@
private void parseLockScope(Element lockScopeElement) throws JDOMException {
if (lockScopeElement == null) {
- throw new JDOMException("Expected <"+E_LOCKSCOPE+"> element");
+ throw new JDOMException("Expected <"+E_LOCKSCOPE+"> element");
}
List children = lockScopeElement.getChildren();
if (children.size() != 1) {
- throw new JDOMException("<"+E_LOCKSCOPE+"> must have exactly one
child element");
+ throw new JDOMException("<"+E_LOCKSCOPE+"> must have exactly one child
element");
}
lockInfo_lockScope = ((Element)children.get(0)).getName();
@@ -379,12 +379,12 @@
private void parseLockType(Element lockTypeElement) throws JDOMException {
if (lockTypeElement == null) {
- throw new JDOMException("Expected <"+E_LOCKTYPE+"> element");
+ throw new JDOMException("Expected <"+E_LOCKTYPE+"> element");
}
List children = lockTypeElement.getChildren();
if (children.size() != 1) {
- throw new JDOMException("<"+E_LOCKTYPE+"> must have exactly one
child element");
+ throw new JDOMException("<"+E_LOCKTYPE+"> must have exactly one child
element");
}
lockInfo_lockType = ((Element)children.get(0)).getName();
@@ -403,7 +403,7 @@
if (ownerElement == null) {
lockInfo_lockOwner = DEFAULT_LOCK_OWNER;
-// throw new JDOMException("Expected <"+E_OWNER+"> element");
+// throw new JDOMException("Expected <"+E_OWNER+"> element");
}
StringWriter stringWriter = new StringWriter();
@@ -420,7 +420,7 @@
if (lockInfo_lockOwner.length() == 0) {
lockInfo_lockOwner = DEFAULT_LOCK_OWNER;
-// throw new JDOMException("<"+E_OWNER+"> element must not be
empty");
+// throw new JDOMException("<"+E_OWNER+"> element must not be empty");
}
}
1.28 +4 -4
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.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- OptionsMethod.java 14 Jun 2002 12:24:05 -0000 1.27
+++ OptionsMethod.java 27 Jun 2002 10:49:58 -0000 1.28
@@ -133,7 +133,7 @@
Element oe = parseRequestContent().getRootElement();
if( oe == null || !oe.getName().equals(E_OPTIONS) ) {
Domain.warn( "Root element must be "+E_OPTIONS );
- throw new JDOMException("Root element must be
<"+E_OPTIONS+">");
+ throw new JDOMException("Root element must be <"+E_OPTIONS+">");
}
Iterator i = oe.getChildren().iterator();
while( i.hasNext() ) {
1.55 +5 -5
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java
Index: PropPatchMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PropPatchMethod.java,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- PropPatchMethod.java 26 Jun 2002 05:00:00 -0000 1.54
+++ PropPatchMethod.java 27 Jun 2002 10:49:59 -0000 1.55
@@ -190,7 +190,7 @@
// Get the root element of the document
Element rootElement = document.getRootElement();
if ( (rootElement == null) || ( !
E_PROPERTYUPDATE.equals(rootElement.getName()) ) ) {
- throw new JDOMException("<"+E_PROPERTYUPDATE+"> element
missing");
+ throw new JDOMException("<"+E_PROPERTYUPDATE+"> element
missing");
}
Iterator childrenIterator = rootElement.getChildren().iterator();
Element child = null;
@@ -203,7 +203,7 @@
propertiesToRemove.add(getPropElement(child));
}
else {
- throw new JDOMException("Expected <"+E_SET+"> or
<"+E_REMOVE+"> element");
+ throw new JDOMException("Expected <"+E_SET+"> or
<"+E_REMOVE+"> element");
}
}
1.18 +5 -7
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java
Index: VersionControlMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- VersionControlMethod.java 27 Jun 2002 09:03:22 -0000 1.17
+++ VersionControlMethod.java 27 Jun 2002 10:49:59 -0000 1.18
@@ -147,8 +147,7 @@
Element ve = null;
if( vce == null || !vce.getName().equals(E_VERSION_CONTROL) ) {
Domain.warn( "Root element must be "+E_VERSION_CONTROL );
- resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
- throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
+ throw new JDOMException("Root element must be
<"+E_VERSION_CONTROL+">");
}
Iterator i = vce.getChildren().iterator();
while( i.hasNext() ) {
@@ -165,8 +164,7 @@
}
catch( Exception x ) {
Domain.warn( E_VERSION+" element must contain
"+E_HREF+" element" );
- resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
- throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
+ throw new JDOMException("<"+E_VERSION+"> element must
contain <"+E_HREF+"> element" );
}
break;
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>