Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 8e474a9e authored by Gabriel Landais's avatar Gabriel Landais
Browse files

Explain error

git-svn-id: https://scm.gforge.inria.fr/authscm/ycadoret/svn/gazelle/Maven/gazelle-proxy/trunk@35173 356b4b1a-1d2b-0410-8bf1-ffa24008f01e
parent 31531632
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,7 @@ import org.apache.commons.io.FileUtils; ...@@ -41,6 +41,7 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.dcm4che2.tool.dcm2txt.Dcm2Txt; import org.dcm4che2.tool.dcm2txt.Dcm2Txt;
import org.jboss.resteasy.client.ClientExecutor; import org.jboss.resteasy.client.ClientExecutor;
...@@ -155,12 +156,12 @@ public class MessageBean { ...@@ -155,12 +156,12 @@ public class MessageBean {
} }
public void downloadFile(boolean inline) { public void downloadFile(boolean inline) {
HttpServletResponse response = (HttpServletResponse) extCtx.getResponse();
InputStream messageStream = message.getMessageReceivedStream();
ServletOutputStream servletOutputStream = null;
try { try {
HttpServletResponse response = (HttpServletResponse) extCtx.getResponse();
InputStream messageStream = message.getMessageReceivedStream();
ServletOutputStream servletOutputStream = response.getOutputStream();
response.setContentType("text/plain"); response.setContentType("text/plain");
servletOutputStream = response.getOutputStream();
if (!inline) { if (!inline) {
response.setHeader("Content-Disposition", "attachment;filename=\"" + message.getId() + "\""); response.setHeader("Content-Disposition", "attachment;filename=\"" + message.getId() + "\"");
} }
...@@ -195,7 +196,12 @@ public class MessageBean { ...@@ -195,7 +196,12 @@ public class MessageBean {
facesContext.responseComplete(); facesContext.responseComplete();
} catch (Exception e) { } catch (Exception e) {
log.error("Failed to download file", e); log.error("Failed to download file", e);
FacesMessages.instance().add(StatusMessage.Severity.ERROR, "Failed to download file", e); try {
IOUtils.write("Failed to download file " + ExceptionUtils.getFullStackTrace(e), servletOutputStream);
} catch (IOException e1) {
log.error("Failed to send error to browser", e);
}
// FacesMessages.instance().add(StatusMessage.Severity.ERROR, "Failed to download file", e);
} }
} }
...@@ -438,7 +444,8 @@ public class MessageBean { ...@@ -438,7 +444,8 @@ public class MessageBean {
// Chemin vers evs client // Chemin vers evs client
String validatorUrl = Preferences.getProperty("evsclient.url"); // "http://192.168.20.100:8080/EVSClient/" String validatorUrl = Preferences.getProperty("evsclient.url"); // "http://192.168.20.100:8080/EVSClient/"
ClientRequest request = new ClientRequest(validatorUrl.concat("resteasy/GetValidationPermanentLink"), CLIENT_EXECUTOR); ClientRequest request = new ClientRequest(validatorUrl.concat("resteasy/GetValidationPermanentLink"),
CLIENT_EXECUTOR);
request.queryParameter("oid", oid); request.queryParameter("oid", oid);
ClientResponse<String> response = null; ClientResponse<String> response = null;
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment