コード例 #1
0
  public static void loadProperties(File file) {

    Properties props = new Properties();
    try {
      props.load(new FileInputStream(file));
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      MessageLog.getInstance().addMessage("Unable to load properties: " + e.getMessage());
    } catch (IOException e) {
      e.printStackTrace();
      MessageLog.getInstance().addMessage("Unable to load properties: " + e.getMessage());
    }

    OAuthPropertyBean pBean = OAuthPropertyBean.getInstance();
    pBean.setAzHost(props.getProperty(OAuthPropertyBean.AZ_HOST, ""));
    pBean.setAzPort(props.getProperty(OAuthPropertyBean.AZ_PORT, ""));
    pBean.setAzUri(props.getProperty(OAuthPropertyBean.AZ_URI, ""));
    pBean.setClientId(props.getProperty(OAuthPropertyBean.CLIENT_ID, ""));
    pBean.setClientSecret(props.getProperty(OAuthPropertyBean.CLIENT_SECRET, ""));
    pBean.setScope(props.getProperty(OAuthPropertyBean.SCOPE, ""));
    pBean.setState(props.getProperty(OAuthPropertyBean.STATE, ""));
    pBean.setAccessUri(props.getProperty(OAuthPropertyBean.ACCESS_URI, ""));
  }
コード例 #2
0
 private void updateProperties() {
   // Doing this the lazy way until I figure out exactly which field has changed.
   OAuthPropertyBean prop = OAuthPropertyBean.getInstance();
   prop.setAzHost(tf_host.getText());
   prop.setAzPort(tf_port.getText());
 }