ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gene...@ws.apache.org
Subject [Apache Web Services Wiki] New: FrontPage/Axis/AttachmentsSpecifyFilename
Date Tue, 11 Jan 2005 10:42:23 GMT
   Date: 2005-01-11T02:42:23
   Editor: ToshiyukiKimura
   Wiki: Apache Web Services Wiki
   Page: FrontPage/Axis/AttachmentsSpecifyFilename
   URL: http://wiki.apache.org/ws/FrontPage/Axis/AttachmentsSpecifyFilename

   Importing old wiki ...

New Page:

##language:en
'''Q: How do I specify where attachments are written?'''

A: Just write the output yourself, for example: 

{{{
   Iterator       iterator = call.getResponseMessage().getAttachments(); 
   AttachmentPart part     = (AttachmentPart) iterator.next(); 
   DataHandler    dh       = part.getDataHandler(); 

   dh.writeTo(new java.io.FileOutputStream("completeFilePathWhereYouWantTheFileWrittenTo"));

}}}
 
or force Axis to generate the temp file and move it around your file system: 

{{{
    new java.io.File(dh.getName()).renameTo("TheFileYouReallyWant"); 
}}}

Mime
View raw message