Brain,
Proper method is to use the functionality provided by DataHandler and
DataSource. DataHandler will not read the attachment in to the memory In the
case of a large attachment when it is cached in the temp dir. I In that
scenerio DataHandler will run off on file data source object which will in
turn refer to the physical temp file...

~Thilina

On 12/20/06, Brian Bacsu <[EMAIL PROTECTED]> wrote:


Thilina:

Thanks for the information. I will try that. The reason for using the
cache was to avoid placing very large files in memory, but if the cache is
for Axis2 internal use, what is the proper method to access/utilize these
files, once they have been obtained from the response, and stored in the
temp directory.

Thanks,

Brian Bacsu




 *"Thilina Gunarathne" <[EMAIL PROTECTED]>*

12/19/2006 02:04 PM  Please respond to
[email protected]

  To
[email protected]  cc

 Subject
Re: Naming of MTOM cached attachment files






Hi,
Actually the temp directory is meant for Axis2 internal use.  Also
only the attachments which are larger than the file size threshold
will get stored there...

But u can manipulate those files in the following way by adding some
code to the business logic.. (Make sure to make the file size
threshold 0)..

DataHandler dataHandler = (DataHandler)omText.getDataHandler();
// You can check the data source type for added safety
FileDataSource fileDataSource =
(FileDataSource)dataHandler.getDataSource();
File file = fileDataSource.getFile();
//Rename to your desired file name
file.renameTo(new File("MyFile.bin"));

Thanks,
Thilina

On 12/19/06, Brian Bacsu <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I am using the cache feature of Axis2 1.1 for very large MTOM
attachments in
> a client component. Currently the files are being saved into the defined
> temporary directory with a naming format similar to "Axis28105.att,
> Axis28106.att, etc.  This naming convention makes it very difficult to
> identify which file was placed in the temp directory by which user, so
that
> the file can be retrieved and the temp directory cleaned up.  I am
wondering
> how/where these names are constructed?
>
> Is there any method to control the naming of the cached file, or to
obtain
> the name that will be used during the processing of the MTOM response?
>
>
>
> Thanks,
>
>  Brian Bacsu
>


--
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: 
http://webservices.apache.org/~thilina/<http://webservices.apache.org/%7Ethilina/>
Blog: http://thilinag.blogspot.com/

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





--
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: http://webservices.apache.org/~thilina/
Blog: http://thilinag.blogspot.com/

Reply via email to