/*
 * Store all user regular properties, unregistered JREs, and (registered &&
 * confirmed) JREs in the user properties file
 */
void StoreConfigurationFile(int verbose) {
  char propFullFileName[MAXPATHLEN];
  
  /* Build string to user-specific propFileName (e.g., "deployment.properties"
     or "deployment.properties.jdpa") */
  sysStrNPrintF(propFullFileName, sizeof(propFullFileName), "%s%c%s",
          sysGetDeploymentUserHome(),
          FILE_SEPARATOR,
          CFG_FILENAME);

  storePropertyFile(propFullFileName, UserCfgFileHead);
  if (verbose) {
    printf("StoreConfigurationFile: %s\n", propFullFileName);
    PrintPropertyEntry(UserCfgFileHead);
  }
}  
/* CL: Code factored out of original version of LoadConfigurationFile(),
 * so this code can be used by other types of configuration loading
 * functions if desired.
 */
void LoadCfgFile(char* propFileName, PropertyFileEntry** UserPropertyFileEntry, int verbose) {
  char propFullFileName[MAXPATHLEN];
 
  /* Build string to user-specific property file name
     (e.g., "deployment.properties" or "deployment.properties.jdpa") */
  sysStrNPrintF(propFullFileName, sizeof(propFullFileName), "%s%c%s",
          sysGetDeploymentUserHome(),
          FILE_SEPARATOR,
          propFileName);

  /* Load and parse the users configuration property file, adding to system */
  *UserPropertyFileEntry = parsePropertyFile(propFullFileName, NULL); 
  if (verbose) {
    printf("LoadCfgFile: %s\n", propFullFileName);
    PrintPropertyEntry(*UserPropertyFileEntry);
  }
}
示例#3
0
/* return 1 if file is found, otherwise 0 */
int sysFindSiFile(char *canonicalHome, char *siFilename) {
  char searchPath[MAXPATHLEN];
  WIN32_FIND_DATA FindFileData;
  HANDLE hFind;

  sysReplaceChar(canonicalHome, '/', '_');

  sysReplaceChar(canonicalHome, ':', '_');
  
  sprintf(searchPath, "%s%c%s%c%s%c%s%c", sysGetDeploymentUserHome(), FILE_SEPARATOR, "tmp", FILE_SEPARATOR, "si", FILE_SEPARATOR, canonicalHome, '*');

  hFind = FindFirstFile(searchPath, &FindFileData);

  if (hFind == INVALID_HANDLE_VALUE) { 
    return 0;
  }

  strcpy(siFilename, FindFileData.cFileName);

  FindClose(hFind);
  
  return 1;
}