[ 
http://issues.apache.org/jira/browse/AXIS2-1148?page=comments#action_12434460 ] 
            
Roshan Punnoose commented on AXIS2-1148:
----------------------------------------

Instead of putting the whole file in here, here is the snippet I changed:

Two changes:
1. Line 179: cacheAttachmentString = (String) cacheAttachmentProperty
2. Line 212: attachmentSizeThreshold = (String) attachmentSizeThresholdProperty;

Below is the snippet of code from selectBuilderForMIME: (I added instanceofs 
because we can't assume the properties will be Strings)

Object cacheAttachmentProperty = msgContext
                                
.getProperty(Constants.Configuration.CACHE_ATTACHMENTS);
                String cacheAttachmentString = null;
                boolean fileCacheForAttachments;

                if (cacheAttachmentProperty != null && cacheAttachmentProperty 
instanceof String) {
                        cacheAttachmentString = (String) 
cacheAttachmentProperty;
                        fileCacheForAttachments = (Constants.VALUE_TRUE
                                        .equals(cacheAttachmentString));
                } else {
                        Parameter parameter_cache_attachment = msgContext
                                        
.getParameter(Constants.Configuration.CACHE_ATTACHMENTS);
                        cacheAttachmentString = (parameter_cache_attachment != 
null) ? (String) parameter_cache_attachment
                                        .getValue()
                                        : null;
                }
                fileCacheForAttachments = (Constants.VALUE_TRUE
                .equals(cacheAttachmentString));

                String attachmentRepoDir = null;
                String attachmentSizeThreshold = null;

                if (fileCacheForAttachments) {
                        Object attachmentRepoDirProperty = msgContext
                                        
.getProperty(Constants.Configuration.ATTACHMENT_TEMP_DIR);

                        if (attachmentRepoDirProperty != null) {
                                attachmentRepoDir = (String) 
attachmentRepoDirProperty;
                        } else {
                                Parameter attachmentRepoDirParameter = 
msgContext
                                                
.getParameter(Constants.Configuration.ATTACHMENT_TEMP_DIR);
                                attachmentRepoDir = (attachmentRepoDirParameter 
!= null) ? (String) attachmentRepoDirParameter
                                                .getValue()
                                                : null;
                        }

                        Object attachmentSizeThresholdProperty = msgContext
                                        
.getProperty(Constants.Configuration.FILE_SIZE_THRESHOLD);
                        if (attachmentSizeThresholdProperty != null && 
attachmentSizeThresholdProperty instanceof String) {
                                attachmentSizeThreshold = (String) 
attachmentSizeThresholdProperty;
                        } else {
                                Parameter attachmentSizeThresholdParameter = 
msgContext
                                                
.getParameter(Constants.Configuration.FILE_SIZE_THRESHOLD);
                                attachmentSizeThreshold = 
attachmentSizeThresholdParameter
                                                .getValue().toString();
                        }
                }

> Bug in TransportUtils with the file caching
> -------------------------------------------
>
>                 Key: AXIS2-1148
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1148
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0
>         Environment: Weblogic 8.1, Axis2 Client
>            Reporter: Roshan Punnoose
>
> Ok, maybe I'm not looking at this right, but I think I see a bug in
> TransportUtils.selectBuilderForMIME(...):
>                 Object cacheAttachmentProperty = msgContext
> .getProperty(Constants.Configuration.CACHE_ATTACHMENTS);
>                 String cacheAttachmentString = null;
>                 boolean fileCacheForAttachments;
>                 if (cacheAttachmentProperty != null) {
>                         cacheAttachmentProperty =
> cacheAttachmentProperty;
>                         fileCacheForAttachments = (Constants.VALUE_TRUE
>                                         .equals(cacheAttachmentString));
> The cacheAttachmentString is always going to be null right? Then, the
> client will never actually cache the attachment in the temp directory if
> the properties have been set. Right? Am I going crazy?
> If you want, I can post my fix for it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to