diff options
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow')
3 files changed, 30 insertions, 5 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java index 3cf0861f..f720cb57 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java @@ -28,8 +28,13 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.cliarguments.ArgumentHandler; import at.asit.pdfover.gui.cliarguments.BKUArgument; import at.asit.pdfover.gui.cliarguments.ConfigFileArgument; +import at.asit.pdfover.gui.cliarguments.EmblemArgument; import at.asit.pdfover.gui.cliarguments.HelpArgument; +import at.asit.pdfover.gui.cliarguments.OutputFolderArgument; +import at.asit.pdfover.gui.cliarguments.PasswordArgument; import at.asit.pdfover.gui.cliarguments.PhoneNumberArgument; +import at.asit.pdfover.gui.cliarguments.ProxyHostArgument; +import at.asit.pdfover.gui.cliarguments.ProxyPortArgument; import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.exceptions.InitializationException; import at.asit.pdfover.gui.workflow.ConfigManipulator; @@ -53,7 +58,11 @@ public class PrepareConfigurationState extends State { this.handler.addCLIArgument(new HelpArgument()); this.handler.addCLIArgument(new BKUArgument()); this.handler.addCLIArgument(new PhoneNumberArgument()); - + this.handler.addCLIArgument(new EmblemArgument()); + this.handler.addCLIArgument(new PasswordArgument()); + this.handler.addCLIArgument(new ProxyHostArgument()); + this.handler.addCLIArgument(new ProxyPortArgument()); + this.handler.addCLIArgument(new OutputFolderArgument()); // adding config file argument to this handler so it appears in help this.handler.addCLIArgument(new ConfigFileArgument()); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java index 4ed59e5a..38215593 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java @@ -65,6 +65,20 @@ public class PrepareSigningState extends State { ConfigProvider configuration = this.state.stateMachine.getConfigProvider(); + // SET PROXY HOST and PORT settings + String proxyHost = configuration.getProxyHost(); + int proxyPort = configuration.getProxyPort(); + + if(proxyPort > 0 && proxyPort <= 0xFFFF) { + System.setProperty("http.proxyPort", Integer.toString(proxyPort)); //$NON-NLS-1$ + System.setProperty("https.proxyPort", Integer.toString(proxyPort)); //$NON-NLS-1$ + } + + if(proxyHost != null && !proxyHost.equals("")) { //$NON-NLS-1$ + System.setProperty("http.proxyHost", proxyHost); //$NON-NLS-1$ + System.setProperty("https.proxyHost", proxyHost); //$NON-NLS-1$ + } + if(this.state.signer == null) { this.state.signer = this.state.stateMachine.getPDFSigner().getPDFSigner(); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/TrustedSocketFactory.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/TrustedSocketFactory.java index 91aa6caa..c7430bab 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/TrustedSocketFactory.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/TrustedSocketFactory.java @@ -36,6 +36,8 @@ import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import at.asit.pdfover.gui.Messages; + /** * */ @@ -78,7 +80,7 @@ public class TrustedSocketFactory implements ProtocolSocketFactory { throw (UnknownHostException) ex; } else { throw new IOException( - "Not really an IOException! See inner exception", ex); + Messages.getString("TrustedSocketFactory.FailedToCreateSecureConnection"), ex); //$NON-NLS-1$ } } } @@ -106,7 +108,7 @@ public class TrustedSocketFactory implements ProtocolSocketFactory { throw (UnknownHostException) ex; } else { throw new IOException( - "Not really an IOException! See inner exception", ex); + Messages.getString("TrustedSocketFactory.FailedToCreateSecureConnection"), ex); //$NON-NLS-1$ } } } @@ -125,7 +127,7 @@ public class TrustedSocketFactory implements ProtocolSocketFactory { UnknownHostException, ConnectTimeoutException { try { if (params == null) { - throw new IllegalArgumentException("Parameters may not be null"); + throw new IllegalArgumentException("Parameters may not be null"); //$NON-NLS-1$ } int timeout = params.getConnectionTimeout(); Socket socket = null; @@ -151,7 +153,7 @@ public class TrustedSocketFactory implements ProtocolSocketFactory { throw (UnknownHostException) ex; } else { throw new IOException( - "Not really an IOException! See inner exception", ex); + Messages.getString("TrustedSocketFactory.FailedToCreateSecureConnection"), ex); //$NON-NLS-1$ } } } |