if(assetClassName.equals("Entity")) { aad.setType(AgentAssetData.ENTITY); }
  public AgentAssetData parsePrototypeFile(String cId) {    clusterId = cId;    String dataItem = "";    int newVal;    String filename = getFileName();    BufferedReader input = null;    Reader fileStream = null;    AgentAssetData aad = new AgentAssetData(null);    if(log.isDebugEnabled()) {      log.debug("Setting INI Format to: OLD_FORMAT");    }    aad.setIniFormat(AgentAssetData.OLD_FORMAT);    try {      File tryfile = new File(filename);      if (! tryfile.exists()) {	fileStream = 	  //	  new InputStreamReader(ConfigFinder.getInstance().open(filename));	  new InputStreamReader(SocietyFinder.getInstance().open(filename));      } else {	fileStream = new FileReader(tryfile);      }      input = new BufferedReader(fileStream);      StreamTokenizer tokens = new StreamTokenizer(input);      tokens.commentChar('#');      tokens.wordChars('[', ']');      tokens.wordChars('_', '_');      tokens.wordChars('<', '>');            tokens.wordChars('/', '/');            tokens.ordinaryChars('0', '9');            tokens.wordChars('0', '9');            newVal = tokens.nextToken();      // Parse the prototype-ini file      while (newVal != StreamTokenizer.TT_EOF) {        if (tokens.ttype != StreamTokenizer.TT_WORD)          formatError("ttype: " + tokens.ttype + " sval: " + tokens.sval);        dataItem = tokens.sval;        if (dataItem.equals("[Prototype]")) {          newVal = tokens.nextToken();          String assetClassName = tokens.sval;          aad.setAssetClass(assetClassName);          if(log.isDebugEnabled()) {            log.debug("AgentAssetData Class: " + aad.getAssetClass());          }          if(assetClassName.equals("Entity")) {            aad.setType(AgentAssetData.ENTITY);          }          newVal = tokens.nextToken();          continue;        }        if (dataItem.equals("[Relationship]")) {          newVal = fillRelationships(newVal, tokens, aad);          continue;        }        if (dataItem.equals("[LocationSchedulePG]")) {          if(log.isDebugEnabled()) {            log.debug("Parsing LocationSchedulePG");          }          // parser language is currently incapable of expressing a           // complex schedule, so here we hack in some minimal support.//           newVal = setLocationSchedulePG(dataItem, newVal, tokens);          continue;        }        if (dataItem.equals("[UniqueId]")) {          newVal = tokens.nextToken();          aad.setUniqueID(tokens.sval);          if(log.isDebugEnabled()) {            log.debug("Parsing UniqueId: " + aad.getUniqueID());          }          newVal = tokens.nextToken();          continue;        }        if (dataItem.equals("[UIC]")) {          newVal = tokens.nextToken();          aad.setUIC(tokens.sval);          if(log.isDebugEnabled()) {            log.debug("Parsing UIC: " + aad.getUIC());          }          newVal = tokens.nextToken();          continue;        }        if (dataItem.startsWith("[")) {          // We've got a property or capability           newVal = setPropertyForAsset(dataItem, newVal, tokens, aad);          continue;        }        // if The token you read is not one of the valid        // choices from above        formatError("Incorrect token: " + dataItem);      }      // Closing BufferedReader      if (input != null)	input.close();      // Only generates a NoSuchMethodException for AssetSkeleton      // because of a coding error. If we are successul in creating it      // here it then the AssetSkeleton will end up with two copies      // the add/search criteria in AssetSkeleton is for a Vector and      // does not gurantee only one instance of each class. Thus the      // Org allocator plugin fails to recognize the correct set of      // capabilities.          } catch (Exception e) {      if(log.isErrorEnabled()) {        log.error("Exception", e);      }    }    return aad;  } 