コード例 #1
0
  protected static void saveInstanceProperties(Properties props) {
    BaseUtil.out("--- 1 SuiteManager : saveInstanceProperties()");
    String uri = props.getProperty(BaseConstants.URL_PROP);
    String projDir = props.getProperty(BaseConstants.SERVER_LOCATION_PROP);
    if (uri == null) {
      BaseUtil.out("--- 2 SuiteManager : saveInstanceProperties() uri == null");

      return;
    }
    BaseUtil.out("--- 3 SuiteManager : saveInstanceProperties() uri = " + uri);

    InstancePreferences prefs = getNbInstanceProperties(projDir, uri);
    props.forEach(
        (k, v) -> {
          BaseUtil.out(
              "--- 4 SuiteManager : saveInstanceProperties() key = " + k + "; value = " + v);

          prefs.setProperty((String) k, (String) v);
        });
  }
コード例 #2
0
  protected static void updateInstanceRegistry(Properties props) {
    Path dirpath = Paths.get("d:\\Netbeans_810_Plugins\\TestApps\\AMEmbServer04");

    NbDirectoryPreferences ppp =
        new NbDirectoryPreferences(dirpath, "uid-025c0287-3243-4a16-837e-94be30ecfc19");
    int l = ppp.childrenNames().length;
    BaseUtil.out(
        "--- 0000001 SuiteManager : updateInstanceRegistry I test NbDirectoryPreferences lengt="
            + l);

    BaseUtil.out("--- 1 SuiteManager : updateInstanceRegistry(Properties)");

    String serverLocation = props.getProperty(BaseConstants.SERVER_LOCATION_PROP);
    BaseUtil.out(
        "--- 2 SuiteManager : updateInstanceRegistry(Properties) serverLocation = "
            + serverLocation);

    InstancePreferences prefs = getInstanceProperties(serverLocation);

    props.forEach(
        (k, v) -> {
          BaseUtil.out(
              "--- 2 SuiteManager : updateInstanceRegistry(Properties) key = "
                  + k
                  + "; value = "
                  + v);

          prefs.setProperty((String) k, (String) v);
        });

    String shutdownPort = props.getProperty(BaseConstants.SHUTDOWN_PORT_PROP);
    if (shutdownPort == null) { // Cannot be
      shutdownPort = String.valueOf(Integer.MAX_VALUE);
      prefs.setProperty(BaseConstants.SHUTDOWN_PORT_PROP, shutdownPort);
    }
  }