From 0293b6ab58632b2d941ebcac14165fd52886f7a1 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:41:40 +0000 Subject: Move User Agent String to Constants git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@452 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java | 3 +++ .../java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java | 5 ----- .../asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java | 6 +++--- .../asit/pdfover/gui/workflow/states/mobilebku/IAIKHandler.java | 8 ++++---- .../pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java | 3 ++- 5 files changed, 12 insertions(+), 13 deletions(-) (limited to 'pdf-over-gui') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java index 2be35d56..4c361819 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Constants.java @@ -60,6 +60,9 @@ public class Constants { /** How far to displace the signature with the arrow keys */ public static final int SIGNATURE_KEYBOARD_POSITIONING_OFFSET = 15; + /** PDF-Over User Agent string */ + public static final String USER_AGENT_STRING = "PDF-Over 4.0"; //$NON-NLS-1$ + /* Configuration parameters */ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java index 31cf1e06..39aa2920 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java @@ -59,11 +59,6 @@ public class LocalBKUState extends State { */ public final static String BKU_RESPONSE_HEADER_SIGNATURE_LAYOUT = "SignatureLayout"; //$NON-NLS-1$ - /** - * PDF Over User Agent string - */ - public static final String PDF_OVER_USER_AGENT_STRING = "PDF-Over 4.0"; //$NON-NLS-1$ - /** * Whether to use Base64 or FileUpload Request */ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java index 0ce95c4e..cfe53ef8 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java @@ -27,11 +27,11 @@ import org.eclipse.swt.widgets.Shell; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import at.asit.pdfover.gui.Constants; import at.asit.pdfover.gui.controls.Dialog; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.controls.Dialog.ICON; import at.asit.pdfover.gui.utils.Messages; -import at.asit.pdfover.gui.workflow.states.LocalBKUState; import at.asit.pdfover.gui.workflow.states.MobileBKUState; import at.asit.pdfover.signator.SLResponse; @@ -96,7 +96,7 @@ public class ATrustHandler extends MobileBKUHandler { HttpClient client = new HttpClient(); client.getParams().setParameter("http.useragent", //$NON-NLS-1$ - LocalBKUState.PDF_OVER_USER_AGENT_STRING); + Constants.USER_AGENT_STRING); PostMethod post = new PostMethod(status.getBaseURL() + "/identification.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$ post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ @@ -169,7 +169,7 @@ public class ATrustHandler extends MobileBKUHandler { HttpClient client = new HttpClient(); client.getParams().setParameter("http.useragent", //$NON-NLS-1$ - LocalBKUState.PDF_OVER_USER_AGENT_STRING); + Constants.USER_AGENT_STRING); PostMethod post = new PostMethod(status.getBaseURL() + "/signature.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/IAIKHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/IAIKHandler.java index b2e81df4..59519050 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/IAIKHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/IAIKHandler.java @@ -31,11 +31,11 @@ import org.eclipse.swt.widgets.Shell; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import at.asit.pdfover.gui.Constants; import at.asit.pdfover.gui.controls.Dialog; import at.asit.pdfover.gui.controls.Dialog.BUTTONS; import at.asit.pdfover.gui.controls.Dialog.ICON; import at.asit.pdfover.gui.utils.Messages; -import at.asit.pdfover.gui.workflow.states.LocalBKUState; import at.asit.pdfover.gui.workflow.states.MobileBKUState; import at.asit.pdfover.signator.SLResponse; @@ -103,7 +103,7 @@ public class IAIKHandler extends MobileBKUHandler { HttpClient client = new HttpClient(); client.getParams().setParameter("http.useragent", //$NON-NLS-1$ - LocalBKUState.PDF_OVER_USER_AGENT_STRING); + Constants.USER_AGENT_STRING); PostMethod post = new PostMethod(status.getBaseURL()); post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ @@ -151,7 +151,7 @@ public class IAIKHandler extends MobileBKUHandler { HttpClient client = new HttpClient(); client.getParams().setParameter("http.useragent", //$NON-NLS-1$ - LocalBKUState.PDF_OVER_USER_AGENT_STRING); + Constants.USER_AGENT_STRING); String redirectURL = status.getBaseURL().substring(0, status.getBaseURL().lastIndexOf('/', @@ -247,7 +247,7 @@ public class IAIKHandler extends MobileBKUHandler { HttpClient client = new HttpClient(); client.getParams().setParameter("http.useragent", //$NON-NLS-1$ - LocalBKUState.PDF_OVER_USER_AGENT_STRING); + Constants.USER_AGENT_STRING); PostMethod post = new PostMethod(status.getBaseURL()); post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ 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 d82585db..5d387351 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 @@ -32,6 +32,7 @@ import org.apache.commons.httpclient.protocol.Protocol; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import at.asit.pdfover.gui.Constants; import at.asit.pdfover.gui.utils.FileUploadSource; import at.asit.pdfover.gui.workflow.states.LocalBKUState; import at.asit.pdfover.gui.workflow.states.MobileBKUState; @@ -79,7 +80,7 @@ public abstract class MobileBKUHandler { HttpClient client = new HttpClient(); client.getParams().setParameter("http.useragent", //$NON-NLS-1$ - LocalBKUState.PDF_OVER_USER_AGENT_STRING); + Constants.USER_AGENT_STRING); PostMethod post = new PostMethod(mobileBKUUrl); -- cgit v1.2.3