You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by petrica <pe...@cluemail.com> on 2007/08/06 07:12:46 UTC

setting client temporary directory for MTOM attachments in CXF

Hi all,

Is there in CXF on the client side something like in XFire for MOTM
attachments ( see below ) ?

service.setProperty(StreamedAttachments.ATTACHMENT_DIRECTORY, new File(
"c:\\temp\\" ));


Thanks in advance, 
Petrica

-- 
View this message in context: http://www.nabble.com/setting-client-temporary-directory-for-MTOM-attachments-in-CXF-tf4222294.html#a12011173
Sent from the cxf-user mailing list archive at Nabble.com.


Re: setting client temporary directory for MTOM attachments in CXF

Posted by "Jeff.Yu" <je...@iona.com>.
Thanks for your comment, it is really a big mistake that I made. I will 
update it very soon.

Thanks
Jeff

Glen Mazza wrote:
> Comments below:
>
>
> +        setAttachementOutputStreamProperties(bos);
> +    private void
> setAttachementOutputStreamProperties(CachedOutputStream bos) throws
> IOException {
>
> Attachment is misspelled above in the two places.
>
> -------------------------------------------------------------------
>
> +    public static final int THRESHOLD = 1024 * 100;   // ???
>
> If you could add a single line comment giving the units the measure here
> (replace my ??? above with "seconds", "bytes", whatever it is)
>
> -------------------------------------------------------------------
>
>  private void setAttachementOutputStreamProperties(CachedOutputStream
> bos) throws IOException {
> +        Object directory =
> message.getContextualProperty(ATTACHMENT_DIRECTORY);
> +        if (directory != null) {
> +            if (directory instanceof File) {
> A                bos.setOutputDir((File)directory);
> +            }
> B            bos.setOutputDir(new File((String)directory));
> +        }
>
> OK, last time I did this with Dan K I turned out to be embarrassingly
> wrong.  But I will try again:
>
> If directory is an instanceof File, not only line A but also line B will
> be run.  I don't think that's what you want.
>
> ----------------------------------------------------------------------
>
> +        
> +        Object threshold =
> message.getContextualProperty(ATTACHMENT_MEMORY_THRESHOLD);
> +        if (threshold != null) {
> +            if (threshold instanceof Long) {
> +A                bos.setThreshold((Long)threshold);
> +            }
> +B bos.setThreshold(Long.valueOf((String)threshold).longValue());
>
>
> Same story here I think.
>
> Regards,
> Glen
>
>
>
> Am Donnerstag, den 09.08.2007, 11:56 +0800 schrieb Jeff.Yu:
>   
>> Hi,
>>
>> I've provided a patch, with a very little change. Can someone please 
>> help me review and apply it if it is okay.
>>
>> Thanks
>> Jeff
>>
>> Daniel Kulp wrote:
>>     
>>> On Monday 06 August 2007 01:12, petrica wrote:
>>>   
>>>       
>>>> Hi all,
>>>>
>>>> Is there in CXF on the client side something like in XFire for MOTM
>>>> attachments ( see below ) ?
>>>>
>>>> service.setProperty(StreamedAttachments.ATTACHMENT_DIRECTORY, new
>>>> File( "c:\\temp\\" ));
>>>>     
>>>>         
>>> I just checked the code and I don't see anything right now.   I've logged 
>>> a Jira to track it as it's a very good idea:
>>> https://issues.apache.org/jira/browse/CXF-888
>>>
>>>
>>>   
>>>       
>
>   

Re: setting client temporary directory for MTOM attachments in CXF

Posted by Glen Mazza <gl...@verizon.net>.
Comments below:


+        setAttachementOutputStreamProperties(bos);
+    private void
setAttachementOutputStreamProperties(CachedOutputStream bos) throws
IOException {

Attachment is misspelled above in the two places.

-------------------------------------------------------------------

+    public static final int THRESHOLD = 1024 * 100;   // ???

If you could add a single line comment giving the units the measure here
(replace my ??? above with "seconds", "bytes", whatever it is)

-------------------------------------------------------------------

 private void setAttachementOutputStreamProperties(CachedOutputStream
bos) throws IOException {
+        Object directory =
message.getContextualProperty(ATTACHMENT_DIRECTORY);
+        if (directory != null) {
+            if (directory instanceof File) {
A                bos.setOutputDir((File)directory);
+            }
B            bos.setOutputDir(new File((String)directory));
+        }

OK, last time I did this with Dan K I turned out to be embarrassingly
wrong.  But I will try again:

If directory is an instanceof File, not only line A but also line B will
be run.  I don't think that's what you want.

----------------------------------------------------------------------

+        
+        Object threshold =
message.getContextualProperty(ATTACHMENT_MEMORY_THRESHOLD);
+        if (threshold != null) {
+            if (threshold instanceof Long) {
+A                bos.setThreshold((Long)threshold);
+            }
+B bos.setThreshold(Long.valueOf((String)threshold).longValue());


Same story here I think.

Regards,
Glen



Am Donnerstag, den 09.08.2007, 11:56 +0800 schrieb Jeff.Yu:
> Hi,
> 
> I've provided a patch, with a very little change. Can someone please 
> help me review and apply it if it is okay.
> 
> Thanks
> Jeff
> 
> Daniel Kulp wrote:
> > On Monday 06 August 2007 01:12, petrica wrote:
> >   
> >> Hi all,
> >>
> >> Is there in CXF on the client side something like in XFire for MOTM
> >> attachments ( see below ) ?
> >>
> >> service.setProperty(StreamedAttachments.ATTACHMENT_DIRECTORY, new
> >> File( "c:\\temp\\" ));
> >>     
> >
> >
> > I just checked the code and I don't see anything right now.   I've logged 
> > a Jira to track it as it's a very good idea:
> > https://issues.apache.org/jira/browse/CXF-888
> >
> >
> >   


Re: setting client temporary directory for MTOM attachments in CXF

Posted by Freeman Fang <fr...@iona.com>.
Hi Jeff,

I will take care of this patch

Thanks

Freeman

Jeff.Yu wrote:
> Hi,
>
> I've just provided another patch for this issue, (the original patch 
> broke the test, now I pass it against all tests),  I've also added a 
> unit test method for it. can someone help me review it.
>
> Thanks
> Jeff
>
> Willem Jiang wrote:
>> Hi Jeff,
>>
>> I just have a quick look of your patch . Here is no unit test in the 
>> patch. Can you also add a unit test for it ?
>>
>> Willem.
>>
>> Jeff.Yu wrote:
>>> Hi,
>>>
>>> I've provided a patch, with a very little change. Can someone please 
>>> help me review and apply it if it is okay.
>>>
>>> Thanks
>>> Jeff
>>>
>>> Daniel Kulp wrote:
>>>> On Monday 06 August 2007 01:12, petrica wrote:
>>>>  
>>>>> Hi all,
>>>>>
>>>>> Is there in CXF on the client side something like in XFire for MOTM
>>>>> attachments ( see below ) ?
>>>>>
>>>>> service.setProperty(StreamedAttachments.ATTACHMENT_DIRECTORY, new
>>>>> File( "c:\\temp\\" ));
>>>>>     
>>>>
>>>>
>>>> I just checked the code and I don't see anything right now.   I've 
>>>> logged a Jira to track it as it's a very good idea:
>>>> https://issues.apache.org/jira/browse/CXF-888
>>>>
>>>>
>>>>   
>>>
>>
>

Re: setting client temporary directory for MTOM attachments in CXF

Posted by "Jeff.Yu" <je...@iona.com>.
Hi,

I've just provided another patch for this issue, (the original patch 
broke the test, now I pass it against all tests),  I've also added a 
unit test method for it. can someone help me review it.

Thanks
Jeff

Willem Jiang wrote:
> Hi Jeff,
>
> I just have a quick look of your patch . Here is no unit test in the 
> patch. Can you also add a unit test for it ?
>
> Willem.
>
> Jeff.Yu wrote:
>> Hi,
>>
>> I've provided a patch, with a very little change. Can someone please 
>> help me review and apply it if it is okay.
>>
>> Thanks
>> Jeff
>>
>> Daniel Kulp wrote:
>>> On Monday 06 August 2007 01:12, petrica wrote:
>>>  
>>>> Hi all,
>>>>
>>>> Is there in CXF on the client side something like in XFire for MOTM
>>>> attachments ( see below ) ?
>>>>
>>>> service.setProperty(StreamedAttachments.ATTACHMENT_DIRECTORY, new
>>>> File( "c:\\temp\\" ));
>>>>     
>>>
>>>
>>> I just checked the code and I don't see anything right now.   I've 
>>> logged a Jira to track it as it's a very good idea:
>>> https://issues.apache.org/jira/browse/CXF-888
>>>
>>>
>>>   
>>
>

Re: setting client temporary directory for MTOM attachments in CXF

Posted by Willem Jiang <ni...@iona.com>.
Hi Jeff,

I just have a quick look of your patch . Here is no unit test in the 
patch. Can you also add a unit test for it ?

Willem.

Jeff.Yu wrote:
> Hi,
>
> I've provided a patch, with a very little change. Can someone please 
> help me review and apply it if it is okay.
>
> Thanks
> Jeff
>
> Daniel Kulp wrote:
>> On Monday 06 August 2007 01:12, petrica wrote:
>>  
>>> Hi all,
>>>
>>> Is there in CXF on the client side something like in XFire for MOTM
>>> attachments ( see below ) ?
>>>
>>> service.setProperty(StreamedAttachments.ATTACHMENT_DIRECTORY, new
>>> File( "c:\\temp\\" ));
>>>     
>>
>>
>> I just checked the code and I don't see anything right now.   I've 
>> logged a Jira to track it as it's a very good idea:
>> https://issues.apache.org/jira/browse/CXF-888
>>
>>
>>   
>

Re: setting client temporary directory for MTOM attachments in CXF

Posted by "Jeff.Yu" <je...@iona.com>.
Hi,

I've provided a patch, with a very little change. Can someone please 
help me review and apply it if it is okay.

Thanks
Jeff

Daniel Kulp wrote:
> On Monday 06 August 2007 01:12, petrica wrote:
>   
>> Hi all,
>>
>> Is there in CXF on the client side something like in XFire for MOTM
>> attachments ( see below ) ?
>>
>> service.setProperty(StreamedAttachments.ATTACHMENT_DIRECTORY, new
>> File( "c:\\temp\\" ));
>>     
>
>
> I just checked the code and I don't see anything right now.   I've logged 
> a Jira to track it as it's a very good idea:
> https://issues.apache.org/jira/browse/CXF-888
>
>
>   

Re: setting client temporary directory for MTOM attachments in CXF

Posted by Daniel Kulp <dk...@apache.org>.
On Monday 06 August 2007 01:12, petrica wrote:
> Hi all,
>
> Is there in CXF on the client side something like in XFire for MOTM
> attachments ( see below ) ?
>
> service.setProperty(StreamedAttachments.ATTACHMENT_DIRECTORY, new
> File( "c:\\temp\\" ));


I just checked the code and I don't see anything right now.   I've logged 
a Jira to track it as it's a very good idea:
https://issues.apache.org/jira/browse/CXF-888


-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog