Skip to content

Commit 076cd8b

Browse files
committed
replace trim/isEmpty with isBlank
1 parent 2e0d092 commit 076cd8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/de/stklcode/jvault/connector/HTTPVaultConnectorBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public HTTPVaultConnectorBuilder withToken(final String token) {
301301
*/
302302
public HTTPVaultConnectorBuilder fromEnv() throws VaultConnectorException {
303303
/* Parse URL from environment variable */
304-
if (System.getenv(ENV_VAULT_ADDR) != null && !System.getenv(ENV_VAULT_ADDR).trim().isEmpty()) {
304+
if (System.getenv(ENV_VAULT_ADDR) != null && !System.getenv(ENV_VAULT_ADDR).isBlank()) {
305305
try {
306306
var url = new URL(System.getenv(ENV_VAULT_ADDR));
307307
this.host = url.getHost();
@@ -325,7 +325,7 @@ public HTTPVaultConnectorBuilder fromEnv() throws VaultConnectorException {
325325
token = System.getenv(ENV_VAULT_TOKEN);
326326

327327
/* Parse certificate, if set */
328-
if (System.getenv(ENV_VAULT_CACERT) != null && !System.getenv(ENV_VAULT_CACERT).trim().isEmpty()) {
328+
if (System.getenv(ENV_VAULT_CACERT) != null && !System.getenv(ENV_VAULT_CACERT).isBlank()) {
329329
return withTrustedCA(Paths.get(System.getenv(ENV_VAULT_CACERT)));
330330
}
331331
return this;

0 commit comments

Comments
 (0)