Hello James you can either 1) file a JIRA https://issues.apache.org/jira/browse/AXIS2
or 2)modify the code and make the change yourself (which would be considerably quicker) org.apache.axis2.saaj.util.SAAJDataSource //change this to protected void flushToDisk( String filename, String ext) throws IOException,FileNotFoundException { protected void flushToDisk() throws IOException, FileNotFoundException { LinkedList ml = memorybuflist; if (ml != null) { if (null == cachediskstream) { // Need to create a disk cache try { /* MessageContext mc = MessageContext.getCurrentContext(); String attdir = (mc == null) ? null : mc.getStrProp( MessageContext.ATTACHMENTS_DIR);*/ MessageContext messageContext = MessageContext.getCurrentMessageContext(); String attachementDir = ""; attachementDir = (String)messageContext.getProperty (Constants.Configuration.ATTACHMENT_TEMP_DIR); if (attachementDir.equals("")) { Parameter param = (Parameter)messageContext.getParameter (Constants.Configuration.ATTACHMENT_TEMP_DIR); if (param != null) { attachementDir = (String)param.getValue(); } } diskCacheFile = java.io.File.createTempFile("Axis", ".att", //diskCacheFile=java.io.File.createTempFile(filename,ext, (attachementDir == null) ? null : new File( attachementDir)); </snip> I'll allow the other engineers opportunity to handle the first 2 queries Martin ______________________________________________ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Tue, 30 Oct 2012 19:12:02 -0400 > Subject: 3 cached file attachment questions > From: grahn...@gmail.com > To: java-user@axis.apache.org > > Greetings, > I'm in the midst of implementing a service (Axis2 1.5.6) that expects > to handle very large attachments. Because of this, we will need to > activate file caching. > > I've looked over some of the documentation and code, but haven't been > able to satisfactorily answer a few questions and hoped I could find > some help on this. > > 1) What is the default behavior of Axis2 with file-cached attachments? > > I have the vague impression that Axis2/Axiom will make a best-effort > attempt to delete the temporary files created, but that this is not > guaranteed (or expected to occasionally fail). There was no explicit > statement to that effect that I found in the documentation. [1] > > I do seem to have found a place in the code that does appear to make > that best-effort deletion attempt. > > -- > > 2) Is there any reason to attempt cache file deletion manually? > > I've read that periodic, scheduled deletion is encouraged. > Presumably this picks up any cases where the best-effort attempt fails > for some reason. [1] > > If Axis2 is attempting file cache deletion already, is there any > reason for manual deletion by the service author? > > I ask mainly because manual deletion appears to be suggested here: [2, via 3] > > -- > > 3) Is there a way to utilize streaming? Is it limited to MIME-only > for Axis2 1.5.6? > > Upon receiving an attachment, my service needs to write out that file > to disk. It would seem optimal, therefore to digest the incoming > stream direct to disk rather than writing to a temporary file and then > copying that file to another location on disk. Is there a way of > doing this? > > I have seen AXIOM-377, which refers to an inability to use MTOM in > this way (for the version of Axiom paired with Axis2 1.5.6). Does > this imply that MIME attachments can be "streamed" in this way, even > if MTOM cannot? (Both are utilized in my services.) > > And is there anything in particular that I should be doing in my code > to "stream" where possible? Any methods to call or avoid calling, > for instance? > > -- > > Thanks, > James > > resources: > [1]: http://axis.apache.org/axis2/java/core/docs/mtom-guide.html#a4 > [2]: http://ws.apache.org/axiom/devguide/ch03.html#d5e340 > [3]: > http://axis2.867.n6.nabble.com/axis2-file-cache-for-attachments-file-name-td4992297.html > [4]: https://issues.apache.org/jira/browse/AXIOM-377 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org > For additional commands, e-mail: java-user-h...@axis.apache.org >