@Test public void testGetPassword() throws Exception { Configuration conf = provisionCredentialsForSSL(); Assert.assertEquals("keypass", WebAppUtils.getPassword(conf, WebAppUtils.WEB_APP_KEY_PASSWORD_KEY)); Assert.assertEquals("storepass", WebAppUtils.getPassword(conf, WebAppUtils.WEB_APP_KEYSTORE_PASSWORD_KEY)); Assert.assertEquals("trustpass", WebAppUtils.getPassword(conf, WebAppUtils.WEB_APP_TRUSTSTORE_PASSWORD_KEY)); Assert.assertEquals(null, WebAppUtils.getPassword(conf,"invalid-alias")); }
static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; }
WebAppUtils { static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; } }
WebAppUtils { static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; }  }
WebAppUtils { static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; }  static void setRMWebAppPort(Configuration conf, int port); static void setRMWebAppHostnameAndPort(Configuration conf,
      String hostname, int port); static void setNMWebAppHostNameAndPort(Configuration conf,
      String hostName, int port); static String getRMWebAppURLWithScheme(Configuration conf); static String getRMWebAppURLWithoutScheme(Configuration conf); static List<String> getProxyHostsAndPortsForAmFilter(
      Configuration conf); static String getProxyHostAndPort(Configuration conf); static String getResolvedRMWebAppURLWithScheme(Configuration conf); static String getResolvedRMWebAppURLWithoutScheme(Configuration conf); static String getResolvedRMWebAppURLWithoutScheme(Configuration conf,
      Policy httpPolicy); static String getWebAppBindURL(
      Configuration conf,
      String hostProperty,
      String webAppURLWithoutScheme); static String getNMWebAppURLWithoutScheme(Configuration conf); static String getAHSWebAppURLWithoutScheme(Configuration conf); static String getURLWithScheme(String schemePrefix, String url); static String getRunningLogURL(
      String nodeHttpAddress, String containerId, String user); static String getAggregatedLogURL(String serverHttpAddress,
      String allocatedNode, String containerId, String entity, String user); static String getHttpSchemePrefix(Configuration conf); static HttpServer2.Builder loadSslConfiguration(
      HttpServer2.Builder builder); static HttpServer2.Builder loadSslConfiguration(
      HttpServer2.Builder builder, Configuration sslConf); }
WebAppUtils { static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; }  static void setRMWebAppPort(Configuration conf, int port); static void setRMWebAppHostnameAndPort(Configuration conf,
      String hostname, int port); static void setNMWebAppHostNameAndPort(Configuration conf,
      String hostName, int port); static String getRMWebAppURLWithScheme(Configuration conf); static String getRMWebAppURLWithoutScheme(Configuration conf); static List<String> getProxyHostsAndPortsForAmFilter(
      Configuration conf); static String getProxyHostAndPort(Configuration conf); static String getResolvedRMWebAppURLWithScheme(Configuration conf); static String getResolvedRMWebAppURLWithoutScheme(Configuration conf); static String getResolvedRMWebAppURLWithoutScheme(Configuration conf,
      Policy httpPolicy); static String getWebAppBindURL(
      Configuration conf,
      String hostProperty,
      String webAppURLWithoutScheme); static String getNMWebAppURLWithoutScheme(Configuration conf); static String getAHSWebAppURLWithoutScheme(Configuration conf); static String getURLWithScheme(String schemePrefix, String url); static String getRunningLogURL(
      String nodeHttpAddress, String containerId, String user); static String getAggregatedLogURL(String serverHttpAddress,
      String allocatedNode, String containerId, String entity, String user); static String getHttpSchemePrefix(Configuration conf); static HttpServer2.Builder loadSslConfiguration(
      HttpServer2.Builder builder); static HttpServer2.Builder loadSslConfiguration(
      HttpServer2.Builder builder, Configuration sslConf); static final String WEB_APP_TRUSTSTORE_PASSWORD_KEY; static final String WEB_APP_KEYSTORE_PASSWORD_KEY; static final String WEB_APP_KEY_PASSWORD_KEY; static final String HTTPS_PREFIX; static final String HTTP_PREFIX; }