public static Properties getUiProperties(HttpServletRequest pRequest)
     throws FileNotFoundException, IOException {
   Properties configProps = new Properties();
   String fileName = ClwCustomizerMyFax.getAbsFilePath(pRequest, "config.txt");
   if (Utility.isSet(fileName)) {
     FileInputStream configIS = new FileInputStream(fileName);
     configProps.load(configIS);
   }
   return configProps;
 }
  /**
   * Returns the store specific/account specific path for the image. @see storeFileImagePath
   * and @see getSIP
   */
  private static String getSIP(
      String pPortal,
      String pFileName,
      String storePrefix,
      Locale locale,
      HashMap filePathHM,
      StoreData storeD,
      AccountData accountD,
      String webDir,
      String rootDir,
      boolean absolutePath) {
    if (pFileName == null) {
      return "";
    }
    pFileName = pFileName.trim();

    // guess at some values if not provided
    if (locale == null) {
      if (accountD != null && Utility.isSet(accountD.getBusEntity().getLocaleCd())) {
        locale = Utility.parseLocaleCode(accountD.getBusEntity().getLocaleCd());
      }
      if (storeD != null && Utility.isSet(storeD.getBusEntity().getLocaleCd())) {
        locale = Utility.parseLocaleCode(storeD.getBusEntity().getLocaleCd());
      }
    }
    if (filePathHM == null) {
      filePathHM = new HashMap();
    }
    if (rootDir == null) {
      rootDir = ClwCustomizerMyFax.getStoreDir();
    }
    if (!Utility.isSet(storePrefix)) {
      storePrefix = storeD.getPrefix().getValue();
    }
    if (!Utility.isSet(webDir)) {
      webDir = System.getProperty("webdeploy");
    }

    if (pPortal == null) pPortal = "store";
    // Make key

    int storeId = 0;
    int accountId = 0;
    String accountDir = "";

    if (storeD != null) {
      storeId = storeD.getBusEntity().getBusEntityId();
    }

    if (accountD != null) {
      accountId = accountD.getBusEntity().getBusEntityId();
      accountDir = accountD.getPropertyValue(RefCodeNames.PROPERTY_TYPE_CD.ACCOUNT_FOLDER);
    }

    String key =
        pPortal
            + "@"
            + locale
            + "@"
            + pFileName
            + "@"
            + storeId
            + "@"
            + accountId
            + "@"
            + absolutePath;
    String resultFilePath = (String) filePathHM.get(key);
    if (resultFilePath != null) {
      return resultFilePath;
    }

    if (storePrefix == null) storePrefix = "";

    // String webDir = System.getProperty("webdeploy");

    if (webDir == null) webDir = "";
    int ind = webDir.indexOf("deploy");
    if (ind < 0) {
      (new Exception("Invalid current directory: " + webDir)).printStackTrace();
      return "";
    }
    // trying to find file
    String storeAcctPrefix =
        (Utility.isSet(accountDir)) ? storePrefix + "/" + accountDir : storePrefix;
    StringTokenizer tok = new StringTokenizer(storeAcctPrefix, "/");
    String[] storeAcctPrefixA = new String[tok.countTokens() + 1];
    storeAcctPrefixA[0] = "";
    ind = 1;
    while (tok.hasMoreTokens()) {
      String nextToken = tok.nextToken();
      if (ind == 1) {
        storeAcctPrefixA[ind] = nextToken;
      } else {
        storeAcctPrefixA[ind] = storeAcctPrefixA[ind - 1] + "/" + nextToken;
      }
      ind++;
    }
    String absPath = "";
    String filePath = "";
    boolean foundFl = false;
    for (int ii = storeAcctPrefixA.length - 1; ii >= 0; ii--) {
      filePath =
          "/" + pPortal + "/" + storeAcctPrefixA[ii] + "/" + locale + "/" + "images/" + pFileName;
      absPath = webDir + filePath;
      File tf = new File(absPath);
      if (tf.exists()) {
        foundFl = true;
        break;
      }

      filePath = "/" + pPortal + "/" + storeAcctPrefixA[ii] + "/" + "images/" + pFileName;
      absPath = webDir + filePath;
      tf = new File(absPath);
      if (tf.exists()) {
        foundFl = true;
        break;
      }

      filePath = "/" + pPortal + "/" + storeAcctPrefixA[ii] + "/" + "images/" + pFileName;
      absPath = webDir + filePath;
      tf = new File(absPath);
      if (tf.exists()) {
        foundFl = true;
        break;
      }

      /*
      filePath = "/" + pPortal + "/" + storeAcctPrefixA[ii] +
                 "/" + "images/"+ pFileName;
      absPath =  webDir + filePath;
      tf = new File(absPath);
      if(tf.exists()) {
          foundFl = true;
          break;
      }
      */
    }

    if (absolutePath) {
      filePath = absPath;
    } else {
      filePath = "/" + rootDir + filePath;
    }
    if (foundFl) {
      filePathHM.put(key, filePath);
    }
    return filePath;
  }