diff options
author | Thomas <thomas.lenz@egiz.gv.at> | 2019-12-04 22:54:51 +0100 |
---|---|---|
committer | Thomas <thomas.lenz@egiz.gv.at> | 2019-12-04 22:54:51 +0100 |
commit | 95b21a826e5d81fdeabcf4673a9e87047edaec9d (patch) | |
tree | d8d55da492dd86041c31d68651afa21c80313362 /eaaf_core_utils/src/main | |
parent | 759ac5f42c6aff901dbeede4fbf1a1d2e08cad0f (diff) | |
download | EAAF-Components-95b21a826e5d81fdeabcf4673a9e87047edaec9d.tar.gz EAAF-Components-95b21a826e5d81fdeabcf4673a9e87047edaec9d.tar.bz2 EAAF-Components-95b21a826e5d81fdeabcf4673a9e87047edaec9d.zip |
to some more code quality tasks
Diffstat (limited to 'eaaf_core_utils/src/main')
4 files changed, 7 insertions, 11 deletions
diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpClientFactory.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpClientFactory.java index 4e8be52e..c60fcd7f 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpClientFactory.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpClientFactory.java @@ -91,7 +91,7 @@ public class HttpClientFactory implements IHttpClientFactory { private final String mode; - private ClientAuthMode(final String mode) { + ClientAuthMode(final String mode) { this.mode = mode; } @@ -132,7 +132,7 @@ public class HttpClientFactory implements IHttpClientFactory { private final String type; - private KeyStoreType(final String type) { + KeyStoreType(final String type) { this.type = type; } diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpUtils.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpUtils.java index 394d2843..1f7601d8 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpUtils.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/HttpUtils.java @@ -62,7 +62,7 @@ public class HttpUtils { // add port if necessary final int port = request.getServerPort(); - if ((protocol.equals("http") && port != 80) || (protocol.equals("https") && port != 443)) { + if (protocol.equals("http") && port != 80 || protocol.equals("https") && port != 443) { buffer.append(':'); buffer.append(port); } @@ -78,8 +78,8 @@ public class HttpUtils { */ public static String extractAuthUrlFromRequest(final HttpServletRequest req) { String authUrl = req.getScheme() + "://" + req.getServerName(); - if ((req.getScheme().equalsIgnoreCase("https") && req.getServerPort() != 443) - || (req.getScheme().equalsIgnoreCase("http") && req.getServerPort() != 80)) { + if (req.getScheme().equalsIgnoreCase("https") && req.getServerPort() != 443 + || req.getScheme().equalsIgnoreCase("http") && req.getServerPort() != 80) { authUrl = authUrl.concat(":" + req.getServerPort()); } authUrl = authUrl.concat(req.getContextPath()); diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/ServletUtils.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/ServletUtils.java index 0d16e9cd..c8865465 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/ServletUtils.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/ServletUtils.java @@ -30,7 +30,7 @@ public class ServletUtils { * @return Context URL */ public static String getBaseUrl(final HttpServletRequest request) { - if ((request.getServerPort() == 80) || (request.getServerPort() == 443)) { + if (request.getServerPort() == 80 || request.getServerPort() == 443) { return request.getScheme() + "://" + request.getServerName() + request.getContextPath(); } else { return request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/StreamUtils.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/StreamUtils.java index cc784870..795b71f7 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/StreamUtils.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/StreamUtils.java @@ -169,11 +169,7 @@ public class StreamUtils { while ((bytesRead = source.read(buffer)) >= 0) { destination.write(buffer, 0, bytesRead); } - } else { - while (source.read(buffer) >= 0) { - - } - } + } } // /** |