diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-04-08 10:25:28 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-04-08 10:25:28 +0200 |
commit | bdbd8c8e6323f79713e4872e07b87daf258a07bb (patch) | |
tree | 46c5cfa233f0953df7450d217ab5be3d03a30ee7 /id/ConfigWebTool/src/main/java | |
parent | ca06c94d7bdd9e058fd41090acddc1cd23640965 (diff) | |
parent | 007475a7d2df25efa5c958a859fa0dc4c923c687 (diff) | |
download | moa-id-spss-bdbd8c8e6323f79713e4872e07b87daf258a07bb.tar.gz moa-id-spss-bdbd8c8e6323f79713e4872e07b87daf258a07bb.tar.bz2 moa-id-spss-bdbd8c8e6323f79713e4872e07b87daf258a07bb.zip |
Merge tag 'MOA-ID-3.1.0' into development_preview
Diffstat (limited to 'id/ConfigWebTool/src/main/java')
-rw-r--r-- | id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/BasicOAAction.java | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/BasicOAAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/BasicOAAction.java index c80bc1925..5bc17f1ee 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/BasicOAAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/BasicOAAction.java @@ -29,6 +29,8 @@ import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -84,7 +86,7 @@ public class BasicOAAction extends BasicAction { private boolean newOA; private boolean isMetaDataRefreshRequired = false; - private InputStream stream; + private InputStream stream = null; /** * @@ -587,8 +589,8 @@ public class BasicOAAction extends BasicAction { ConfigurationProvider config = ConfigurationProvider.getInstance(); String templateURL = config.getConfigRootDir() + ConfigurationProvider.HTMLTEMPLATE_DIR + ConfigurationProvider.HTMLTEMPLATE_FILE; - - File file = new File(templateURL); + + File file = new File(new URI(templateURL)); input = new FileInputStream(file); String contextpath = config.getMOAIDInstanceURL(); @@ -656,6 +658,15 @@ public class BasicOAAction extends BasicAction { } + if (stream == null && MiscUtil.isNotEmpty(preview)) { + try { + stream = new ByteArrayInputStream(preview.getBytes("UTF-8")); + + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + + } + } return Constants.STRUTS_SUCCESS; @@ -699,12 +710,13 @@ public class BasicOAAction extends BasicAction { public void setPvp2OA(OAPVP2Config pvp2oa) { formList.put(pvp2oa.getName(), pvp2oa); } - - /** - * @return the stream - */ - public InputStream getStream() { - return stream; - } - + + /** + * @return the stream + */ + public InputStream getStream() { + return stream; + } + + } |