From bba1cfcc4672a22cb0d0d579d4a51e7ae984f715 Mon Sep 17 00:00:00 2001 From: "peter.danner" Date: Fri, 27 Jul 2007 13:46:51 +0000 Subject: Changed Apache Axis to version 1.4 git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@855 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../spss/server/invoke/ExternalURIResolver.java | 41 ++++++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server/invoke') diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java index 806b76409..106742067 100644 --- a/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java @@ -1,5 +1,8 @@ package at.gv.egovernment.moa.spss.server.invoke; +import iaik.ixsil.exceptions.URIException; +import iaik.ixsil.util.URI; + import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; @@ -7,10 +10,9 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; -import iaik.ixsil.exceptions.URIException; -import iaik.ixsil.util.URI; - import at.gv.egovernment.moa.spss.MOAApplicationException; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; +import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; /** * Resolve external URIs and provide them as a stream. @@ -52,6 +54,39 @@ public class ExternalURIResolver { throw new MOAApplicationException("2213", new Object[] { uriStr }); } + // if we have local content (SOAP with attachments) + if ("formdata".equals(uri.getScheme())) { + TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); + if (context==null) { + //no transaction + throw new MOAApplicationException("2282", new Object[] { uri }); + } else { + + InputStream attachmentIs = context.getAttachmentInputStream(uri); + if (attachmentIs != null) { + setContentType(context.getAttachmentContentType(uri.getPath())); + return attachmentIs; + } else { + //maybe attachments provided but no suiting attachment found + throw new MOAApplicationException("2282", new Object[] { uri }); + } +/* + try { + InputStream attachmentIs = context.getAttachment(uri).getInputStream(); + if (attachmentIs != null) { + setContentType(context.getAttachmentContentType(uri.getPath())); + return attachmentIs; + } else { + //maybe attachments provided but no suiting attachment found + throw new MOAApplicationException("2282", new Object[] { uri }); + } + } catch (IOException e) { + throw new MOAApplicationException("2208", new Object[] { uri }, e); + } +*/ + } + } + // convert URI to URL try { // create the URL -- cgit v1.2.3