@Override public void init(Properties properties) { char[] nameCharArray = properties.get(NAME_PROPERTY), credentialProvidersCharArray = properties.get(CREDENTIAL_PROVIDERS_PROPERTY); if (nameCharArray != null && credentialProvidersCharArray != null) { try { this.setWithCredentialProviders(new String(nameCharArray), new String(credentialProvidersCharArray)); } catch (IOException e) { throw new IllegalArgumentException("Could not extract password from CredentialProvider", e); } return; } throw new IllegalArgumentException( "Expected " + NAME_PROPERTY + " and " + CREDENTIAL_PROVIDERS_PROPERTY + " properties."); }
@Override public void init(Properties properties) { if (properties.containsKey("password")) { setPassword(CharBuffer.wrap(properties.get("password"))); } else throw new IllegalArgumentException("Missing 'password' property"); }
@Override public void destroy() throws DestroyFailedException { for (String key : this.keySet()) { char[] val = this.get(key); Arrays.fill(val, (char) 0); } this.clear(); destroyed = true; }
@Override public void init(Properties properties) { char[] nameCharArray = properties.get(NAME_PROPERTY), credentialProvidersCharArray = properties.get(CREDENTIAL_PROVIDERS_PROPERTY); if (null != nameCharArray && null != credentialProvidersCharArray) { try { this.setWithCredentialProviders(new String(nameCharArray), new String(credentialProvidersCharArray)); } catch (IOException e) { throw new IllegalArgumentException("Could not extract password from CredentialProvider", e); } return; } throw new IllegalArgumentException( "Expected " + NAME_PROPERTY + " and " + CREDENTIAL_PROVIDERS_PROPERTY + " properties."); }
@Override public void destroy() throws DestroyFailedException { for (String key : this.keySet()) { char[] val = this.get(key); Arrays.fill(val, (char) 0); } this.clear(); destroyed = true; }
@Override public void init(Properties properties) { if (properties.containsKey("password")) { setPassword(CharBuffer.wrap(properties.get("password"))); } else throw new IllegalArgumentException("Missing 'password' property"); }