private void setPasswordIfNotBlank(String password) { this.password = stripToNull(password); this.encryptedPassword = stripToNull(encryptedPassword); if (this.password == null) { return; } try { this.encryptedPassword = this.goCipher.encrypt(password); } catch (Exception e) { bomb("Password encryption failed. Please verify your cipher key.", e); } this.password = null; }
private void setPasswordIfNotBlank(String password) { this.password = StringUtils.stripToNull(password); this.encryptedPassword = StringUtils.stripToNull(encryptedPassword); if (this.password == null) { return; } try { this.encryptedPassword = this.goCipher.encrypt(password); } catch (Exception e) { bomb("Password encryption failed. Please verify your cipher key.", e); } this.password = null; }
private void setPasswordIfNotBlank(String password) { this.password = StringUtils.stripToNull(password); this.encryptedPassword = StringUtils.stripToNull(encryptedPassword); if (this.password == null) { return; } try { this.encryptedPassword = this.goCipher.encrypt(password); } catch (Exception e) { bomb("Password encryption failed. Please verify your cipher key.", e); } this.password = null; }
private void setPasswordIfNotBlank(String password) { this.password = StringUtils.stripToNull(password); this.encryptedPassword = StringUtils.stripToNull(encryptedPassword); if (this.password == null) { return; } try { this.encryptedPassword = this.goCipher.encrypt(password); } catch (Exception e) { bomb("Password encryption failed. Please verify your cipher key.", e); } this.password = null; }
private void setPasswordIfNotBlank(String password) { this.password = StringUtils.stripToNull(password); this.encryptedPassword = StringUtils.stripToNull(encryptedPassword); if (this.password == null) { return; } try { this.encryptedPassword = this.goCipher.encrypt(password); } catch (Exception e) { bomb("Password encryption failed. Please verify your cipher key.", e); } this.password = null; }
private void setPasswordIfNotBlank(String password) { this.password = StringUtils.stripToNull(password); this.encryptedPassword = StringUtils.stripToNull(encryptedPassword); if (this.password == null) { return; } try { this.encryptedPassword = this.goCipher.encrypt(password); } catch (Exception e) { bomb("Password encryption failed. Please verify your cipher key.", e); } this.password = null; }
private void setPasswordIfNotBlank(String password) { this.password = StringUtils.stripToNull(password); this.encryptedPassword = StringUtils.stripToNull(encryptedPassword); if (this.password == null) { return; } try { this.encryptedPassword = this.goCipher.encrypt(password); } catch (Exception e) { bomb("Password encryption failed. Please verify your cipher key.", e); } this.password = null; }
private String postBackupScriptFile() { BackupConfig backupConfig = backupConfig(); if (backupConfig != null) { String postBackupScript = backupConfig.getPostBackupScript(); return StringUtils.stripToNull(postBackupScript); } return null; }
@PostConstruct public void ensureEncrypted() { this.userName = StringUtils.stripToNull(this.userName); setPasswordIfNotBlank(password); if (encryptedPassword != null) { setEncryptedPassword(goCipher.maybeReEncryptForPostConstructWithoutExceptions(encryptedPassword)); } }
@PostConstruct public void ensureEncrypted() { this.username = StringUtils.stripToNull(username); setPasswordIfNotBlank(password); if (encryptedPassword != null) { setEncryptedPassword(goCipher.maybeReEncryptForPostConstructWithoutExceptions(encryptedPassword)); } }
@PostConstruct public void ensureEncrypted() { this.userName = StringUtils.stripToNull(this.userName); setPasswordIfNotBlank(password); if (encryptedPassword != null) { setEncryptedPassword(goCipher.maybeReEncryptForPostConstructWithoutExceptions(encryptedPassword)); } }
@PostConstruct public void ensureEncrypted() { this.userName = StringUtils.stripToNull(this.userName); setPasswordIfNotBlank(password); if (encryptedPassword != null) { setEncryptedPassword(goCipher.maybeReEncryptForPostConstructWithoutExceptions(encryptedPassword)); } }
@PostConstruct @Override public void ensureEncrypted() { this.userName = stripToNull(this.userName); setPasswordIfNotBlank(password); if (encryptedPassword != null) { setEncryptedPassword(goCipher.maybeReEncryptForPostConstructWithoutExceptions(encryptedPassword)); } }
@PostConstruct public void ensureEncrypted() { this.userName = StringUtils.stripToNull(this.userName); setPasswordIfNotBlank(password); if (encryptedPassword != null) { setEncryptedPassword(goCipher.maybeReEncryptForPostConstructWithoutExceptions(encryptedPassword)); } }
@PostConstruct @Override public void ensureEncrypted() { this.userName = StringUtils.stripToNull(this.userName); setPasswordIfNotBlank(password); if (encryptedPassword != null) { setEncryptedPassword(goCipher.maybeReEncryptForPostConstructWithoutExceptions(encryptedPassword)); } }
@Test public void testStripToNull_String() { assertNull(StringUtils.stripToNull(null)); assertNull(StringUtils.stripToNull("")); assertNull(StringUtils.stripToNull(" ")); assertNull(StringUtils.stripToNull(StringUtilsTest.WHITESPACE)); assertEquals("ab c", StringUtils.stripToNull(" ab c ")); assertEquals(StringUtilsTest.NON_WHITESPACE, StringUtils.stripToNull(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE)); }
public void setResourceSource(String resourceSource) throws FailureException { resourceSource = StringUtils.stripToNull(resourceSource); if (null == resourceSource) { this.resourceSource = DEFAULT_RESOURCE_SOURCE; } else if (ResourceSource.SPREADSHEET.name().equalsIgnoreCase(resourceSource)) { this.resourceSource = ResourceSource.SPREADSHEET; } else if (ResourceSource.MODEL.name().equalsIgnoreCase(resourceSource)) { this.resourceSource = ResourceSource.MODEL; } else { throw new FailureException("Unknown resource-source option: " + resourceSource); } }
/** * Set the consumer group from the upstream Event Hubs entity that the consumer is part of. Defaults to the * <code>$Default</code> group that is initially present in all Event Hubs entities (unless removed) * * @param consumerGroup the name of the consumer group upstream * @return this input descriptor */ public EventHubsInputDescriptor<StreamMessageType> withConsumerGroup(String consumerGroup) { this.consumerGroup = Optional.of(StringUtils.stripToNull(consumerGroup)); return this; }
/** * Group pattern used by directory partitioner for advanced partitioning. * @param groupPattern group parttern for HDFS consumer inputs. * @return this system descriptor */ public HdfsSystemDescriptor withConsumerGroupPattern(String groupPattern) { this.consumerGroupPattern = Optional.of(StringUtils.stripToNull(groupPattern)); return this; }
/** * Proxy host to be used for this system. * @param proxyHost Proxy host * @return this system descriptor */ public KinesisSystemDescriptor withProxyHost(String proxyHost) { this.proxyHost = Optional.of(StringUtils.stripToNull(proxyHost)); return this; }