You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by th...@apache.org on 2006/09/14 16:43:29 UTC
svn commit: r443367 -
/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
Author: thilina
Date: Thu Sep 14 07:43:29 2006
New Revision: 443367
URL: http://svn.apache.org/viewvc?view=rev&rev=443367
Log:
adding additional safety measures as mentioned in http://issues.apache.org/jira/browse/AXIS2-1148
Modified:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java?view=diff&rev=443367&r1=443366&r2=443367
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java Thu Sep 14 07:43:29 2006
@@ -169,14 +169,15 @@
InputStream inStream, String contentTypeString) throws OMException,
XMLStreamException, FactoryConfigurationError {
StAXBuilder builder = null;
-
+
Object cacheAttachmentProperty = msgContext
.getProperty(Constants.Configuration.CACHE_ATTACHMENTS);
String cacheAttachmentString = null;
boolean fileCacheForAttachments;
- if (cacheAttachmentProperty != null) {
- cacheAttachmentString = (String)cacheAttachmentProperty;
+ if (cacheAttachmentProperty != null
+ && cacheAttachmentProperty instanceof String) {
+ cacheAttachmentString = (String) cacheAttachmentProperty;
fileCacheForAttachments = (Constants.VALUE_TRUE
.equals(cacheAttachmentString));
} else {
@@ -187,7 +188,7 @@
: null;
}
fileCacheForAttachments = (Constants.VALUE_TRUE
- .equals(cacheAttachmentString));
+ .equals(cacheAttachmentString)) ? true : false;
String attachmentRepoDir = null;
String attachmentSizeThreshold = null;
@@ -208,7 +209,8 @@
Object attachmentSizeThresholdProperty = msgContext
.getProperty(Constants.Configuration.FILE_SIZE_THRESHOLD);
- if (attachmentSizeThresholdProperty != null) {
+ if (attachmentSizeThresholdProperty != null
+ && attachmentSizeThresholdProperty instanceof String) {
attachmentSizeThreshold = (String) attachmentSizeThresholdProperty;
} else {
Parameter attachmentSizeThresholdParameter = msgContext
@@ -243,7 +245,7 @@
* Leaving this out for backword compatibility with 1.0
*/
msgContext.setProperty(MTOMConstants.ATTACHMENTS, attachments);
-
+
/*
* Setting the Attachments map to new SwA API
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org