summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java
diff options
context:
space:
mode:
authorBianca Schnalzer <bianca.schnalzer@egiz.gv.at>2017-08-29 10:36:16 +0200
committerBianca Schnalzer <bianca.schnalzer@egiz.gv.at>2017-08-29 10:36:16 +0200
commitf37aa6afcbf59116ba59d3cac9122ae8348614a1 (patch)
treea503a966ed54f46daaba8da8f89c89b2d0e99159 /pdf-over-gui/src/main/java
parent4ff8ebacc9f00324bf135979b080ba47fc7134bd (diff)
downloadpdf-over-f37aa6afcbf59116ba59d3cac9122ae8348614a1.tar.gz
pdf-over-f37aa6afcbf59116ba59d3cac9122ae8348614a1.tar.bz2
pdf-over-f37aa6afcbf59116ba59d3cac9122ae8348614a1.zip
jce lib update, Error Handling
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java7
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java6
2 files changed, 8 insertions, 5 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java
index ee2448f5..46a4dcfc 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/SimpleXMLTrustManager.java
@@ -144,6 +144,7 @@ public class SimpleXMLTrustManager implements X509TrustManager {
}
}
+
for (int i = 0; i < certificates_added_list.getLength(); i++) {
try {
@@ -157,7 +158,9 @@ public class SimpleXMLTrustManager implements X509TrustManager {
log.warn("Ignoring XML node: " + certificateNode.getNodeName()); //$NON-NLS-1$
continue;
}
-
+
+ if (!certificateNode.getTextContent().equals(""))
+ {
String certResource = Constants.RES_CERT_PATH_ADDED + certificateNode.getTextContent();
FileInputStream addedNode = new FileInputStream(certResource);
@@ -170,7 +173,7 @@ public class SimpleXMLTrustManager implements X509TrustManager {
myKeyStore.setCertificateEntry(certificateNode.getTextContent(), cert);
log.debug("Loaded certificate : " + certResource); //$NON-NLS-1$
-
+ }
} catch (Exception ex) {
log.error("Failed to load certificate [" + "]", ex); //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java
index f6c1eb29..31c559db 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/CertificateDownloadSource.java
@@ -119,7 +119,8 @@ public class CertificateDownloadSource {
continue;
}
- ConfigProviderImpl cpi = new ConfigProviderImpl();
+ if (!certificateNode.getTextContent().equals(""))
+ {ConfigProviderImpl cpi = new ConfigProviderImpl();
String certResource = Constants.CERTIFICATE_DOWNLOAD_XML_URL + certificateNode.getTextContent();
log.info("===== Starting to download accepted certificates =====");
@@ -136,8 +137,7 @@ public class CertificateDownloadSource {
}
fis.close();
bis.close();
-
-
+ }
} catch (Exception ex) {
log.debug(ex.toString()); //$NON-NLS-1$
}