diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-07-21 12:52:45 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-07-21 12:52:45 +0200 |
commit | 34289c5982ffdd59e33576a6b47316a6cfb14201 (patch) | |
tree | ae419c87de8c664f3eef32a8540bad0d083a3242 /pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper | |
parent | ea4180c0a643ca741fd8432faf9913706935e4d6 (diff) | |
download | pdf-as-4-34289c5982ffdd59e33576a6b47316a6cfb14201.tar.gz pdf-as-4-34289c5982ffdd59e33576a6b47316a6cfb14201.tar.bz2 pdf-as-4-34289c5982ffdd59e33576a6b47316a6cfb14201.zip |
removed imports, added logging information
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper')
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java | 3 | ||||
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/RemotePDFFetcher.java | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java index a5232acf..6b63255f 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java @@ -837,6 +837,7 @@ public class PdfAsHelper { public static void setErrorURL(HttpServletRequest request, HttpServletResponse response, String url) { HttpSession session = request.getSession(); + logger.debug("[" + session.getId() + "]: Setting Error URL to: " + url); session.setAttribute(PDF_ERR_URL, url); } @@ -850,8 +851,8 @@ public class PdfAsHelper { public static void setInvokeURL(HttpServletRequest request, HttpServletResponse response, String url) { HttpSession session = request.getSession(); + logger.debug("[" + session.getId() + "]: Setting Invoke URL to: " + url); session.setAttribute(PDF_INVOKE_URL, url); - logger.debug("External Invoke URL: " + url); } public static String getInvokeURL(HttpServletRequest request, diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/RemotePDFFetcher.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/RemotePDFFetcher.java index e48a4eee..f3c1c946 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/RemotePDFFetcher.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/RemotePDFFetcher.java @@ -27,17 +27,24 @@ import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import at.gv.egiz.pdfas.common.utils.StreamUtils; import at.gv.egiz.pdfas.web.config.WebConfiguration; import at.gv.egiz.pdfas.web.exception.PdfAsWebException; public class RemotePDFFetcher { + private static final Logger logger = LoggerFactory + .getLogger(RemotePDFFetcher.class); + public static byte[] fetchPdfFile(String pdfURL) throws PdfAsWebException { URL url; try { url = new URL(pdfURL); } catch (MalformedURLException e) { + logger.error("Not a valid URL!", e); throw new PdfAsWebException("Not a valid URL!", e); } if (WebConfiguration.isProvidePdfURLinWhitelist(url.toExternalForm())) { @@ -48,6 +55,7 @@ public class RemotePDFFetcher { InputStream is = url.openStream(); return StreamUtils.inputStreamToByteArray(is); } catch (Exception e) { + logger.error("Failed to fetch pdf document!", e); throw new PdfAsWebException( "Failed to fetch pdf document!", e); } |