aboutsummaryrefslogtreecommitdiff
path: root/spss.server/src/at/gv/egovernment/moa/spss/server/invoke
diff options
context:
space:
mode:
authorpeter.danner <peter.danner@d688527b-c9ab-4aba-bd8d-4036d912da1d>2007-07-27 13:46:51 +0000
committerpeter.danner <peter.danner@d688527b-c9ab-4aba-bd8d-4036d912da1d>2007-07-27 13:46:51 +0000
commitbba1cfcc4672a22cb0d0d579d4a51e7ae984f715 (patch)
treece9a0c069a33cd5dda7fc7ebb5604d638a770ac5 /spss.server/src/at/gv/egovernment/moa/spss/server/invoke
parent3efe2bc76d088426cb8bb6eba7d82cce8eda8f7f (diff)
downloadmoa-id-spss-bba1cfcc4672a22cb0d0d579d4a51e7ae984f715.tar.gz
moa-id-spss-bba1cfcc4672a22cb0d0d579d4a51e7ae984f715.tar.bz2
moa-id-spss-bba1cfcc4672a22cb0d0d579d4a51e7ae984f715.zip
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
Diffstat (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server/invoke')
-rw-r--r--spss.server/src/at/gv/egovernment/moa/spss/server/invoke/ExternalURIResolver.java41
1 files changed, 38 insertions, 3 deletions
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