ambari-server/src/main/java/org/apache/ambari/server/security/encryption/FileBasedCredentialStoreService.java
private void putKeyStore(KeyStore keyStore, File keyStoreFile) throws AmbariException {
    LOG.debug("Writing key store to {}", keyStoreFile.getAbsolutePath());

    FileOutputStream outputStream = null;

    try {
      outputStream = new FileOutputStream(new File(keyStoreDir, KEYSTORE_FILENAME));
      writeKeyStore(keyStore, outputStream);
    } catch (FileNotFoundException e) {
      throw new AmbariException(String.format("Failed to open the key store file: %s", e.getLocalizedMessage()), e);
    } finally {
      IOUtils.closeQuietly(outputStream);
    }
  }
/**
   * Writes the specified KeyStore to a file.
   *
   * @param keyStore     the KeyStore to write to a file
   * @param keyStoreFile the File in which to store the KeyStore data
   * @throws AmbariException if an error occurs while writing the KeyStore data
   */
Writes the specified KeyStore to a file.
@param keyStore     the KeyStore to write to a file
@param keyStoreFile the File in which to store the KeyStore data
@throws AmbariException if an error occurs while writing the KeyStore data
Writes the specified KeyStore to a file . @param keyStore the KeyStore to write to a file @param keyStoreFile the File in which to store the KeyStore data @throws AmbariException if an error occurs while writing the KeyStore data
private void putKeyStore(KeyStore keyStore, File keyStoreFile) throws AmbariException {
    LOG.debug("Writing key store to {}", keyStoreFile.getAbsolutePath());
    FileOutputStream outputStream = null;
    try {
      outputStream = new FileOutputStream(new File(keyStoreDir, KEYSTORE_FILENAME));
      writeKeyStore(keyStore, outputStream);
    } catch (FileNotFoundException e) {
      throw new AmbariException(String.format("Failed to open the key store file: %s", e.getLocalizedMessage()), e);
    } finally {
      IOUtils.closeQuietly(outputStream);
    }
  }
private void putKeyStore ( KeyStore keyStore , File keyStoreFile ) throws AmbariException { LOG . debug ( "Writing key store to {}" , keyStoreFile . getAbsolutePath ( ) ) ; FileOutputStream outputStream = null ; try { outputStream = new FileOutputStream ( new File ( keyStoreDir , KEYSTORE_FILENAME ) ) ; writeKeyStore ( keyStore , outputStream ) ; } catch ( FileNotFoundException e ) { throw new AmbariException ( String . format ( "Failed to open the key store file: %s" , e . getLocalizedMessage ( ) ) , e ) ; } finally { IOUtils . closeQuietly ( outputStream ) ; } }
Writes the specified KeyStore to a file.
Writes the specified KeyStore to a file .