int index = filename.indexOf('.');
int index = filename.lastIndexOf('.');
  public void initProperties() {    // strip off extension if it exists    int index = filename.indexOf('.');    if (index != -1)       filename = filename.substring(0, index);    // Since there are two possible types of asset files, we    // need to determine which parser to use.    // We will determine this by looking for the "UniqueId"    // in the <agent>-ini.dat file.    AgentAssetData aad = null;    if(FileParseUtil.isOldStyleIni(filename + "-prototype-ini.dat")) {      if(log.isDebugEnabled()) {        log.debug("Using oldStyle Parser");      }      aad = PrototypeParser.parse(filename);    } else {      if(log.isDebugEnabled()) {        log.debug("Using newStyle Parser");      }      AssetDataCallbackImpl callback = new AssetDataCallbackImpl(clusterName);      AssetDataFileReader reader = new AssetDataFileReader();      // If this filename is a Windows style filename, then absolute paths wont work.      // Try to let the ConfigFinder find it.      if (filename.indexOf(':') == 1) {	String nfilename = filename.substring(filename.lastIndexOf(File.separatorChar) + 1);	if (log.isDebugEnabled()) {	  log.debug("Agent filename was windows style (" + filename + "), trying short version (" + nfilename + ") & letting ConfigFinder find it. This requires the files be on the ConfigPath");	}	filename = nfilename;      }      reader.readAsset(filename, callback);      // Warning: the above line will cause a FileNotFoundException      // Any time you use a new-style INI      // file that is not your config path      aad = callback.getAgentAssetData();    }    if (aad == null) {      if (log.isErrorEnabled()) {	log.error("Got no AgentAssetData from which to initialize! Perhaps retry with the directory you are loading from on your org.couaar.config.path?");      }      return;    }    this.iniFormat = aad.getIniFormat();    propAssetClass = addProperty(PROP_CLASS, aad.getAssetClass());    propAssetClass.setToolTip(PROP_CLASS_DESC);    String uniqueId = (aad.getUniqueID() != null) ? aad.getUniqueID() : "";    propUniqueID = addProperty(PROP_UID, uniqueId);    propUniqueID.setToolTip(PROP_UID_DESC);        // Unit name is allowed to be null, if it is, give an empty string.    String unitname = (aad.getUnitName() == null) ? "" : aad.getUnitName();    propUnitName = addProperty(PROP_UNITNAME, unitname);    propUnitName.setToolTip(PROP_UNITNAME_DESC);        propUIC = addProperty(PROP_UIC, (aad.getUIC() != null) ? aad.getUIC() : "UIC/" + clusterName);    propUIC.setToolTip(PROP_UIC_DESC);    addPropGroups(aad);    addRelationships(aad.getRelationshipData());  }