From 0a6428b4339ee52dbfc38040217fcc87742d9f88 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:33:50 +0000 Subject: Request debug code git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@383 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../gui/workflow/states/mobilebku/MobileBKUHandler.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pdf-over-gui/src/main/java') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java index e65f2fb9..c868a223 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java @@ -15,6 +15,7 @@ */ package at.asit.pdfover.gui.workflow.states.mobilebku; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -212,6 +213,19 @@ public abstract class MobileBKUHandler { * @throws IOException IO error */ protected String executePost(HttpClient client, PostMethod post) throws IOException { + if (log.isDebugEnabled()) { + String req; + if (post.getRequestEntity().getContentLength() < 1024) { + ByteArrayOutputStream os = new ByteArrayOutputStream(); + post.getRequestEntity().writeRequest(os); + req = os.toString(); + os.close(); + } else { + req = post.getRequestEntity().getContentLength() + " bytes"; //$NON-NLS-1$ + } + log.debug("Posting to " + post.getURI() + ": " + req); //$NON-NLS-1$ //$NON-NLS-2$ + //TODO: Remove me (sensitive data) + } int returnCode = client.executeMethod(post); String redirectLocation = null; -- cgit v1.2.3