if (file == null) { if (log.isErrorEnabled()) log.error("dumpCommXML: unable to get file " + xmlFileFullName); return false; }
  public static boolean dumpCommunityXML(String xmlFileFullName, String assemblyID)  {    if (log.isDebugEnabled()) {      log.debug("dumpCommXML with filename: " + xmlFileFullName + " and ASB " + assemblyID);    }    File file = new File(xmlFileFullName);    try {      if(file.exists())      {        file.delete();        file.createNewFile();      }    } catch (IOException e) {      log.error("dumpCommXML: try to overwrite the file " + xmlFileFullName, e);      return false;    }    RandomAccessFile rfile = null;    try{      rfile = new RandomAccessFile(file, "rw");    } catch(IOException e) {      log.error("Invalid file " + xmlFileFullName, e);      return false;    }    Connection conn = null;    try {      conn = DBUtils.getConnection(csmartQFILE);    } catch(Exception e) {      log.error("try to get connection to database.", e.fillInStackTrace());      return false;    }    Map substitutions = new HashMap();    String assemblyMatch = DBUtils.getListMatch(assemblyID);    if (assemblyMatch != null)      substitutions.put(":assembly_match:", assemblyMatch);    Hashtable community_attrs = getDataFromCommunityTable(assemblyID, conn, substitutions);    Hashtable community_entities = null;    if(community_attrs.size() == 0) {      // No communities for this Assembly      try {	if (conn != null)	  conn.close();      } catch (SQLException e) {	log.error("try to close connection to database", e.fillInStackTrace());      }      // Don't bother looking up the entities      community_entities = new Hashtable();    } else {      community_entities = getDataFromEntityTable(assemblyID, conn, substitutions);    }    try {      if (conn != null)	conn.close();    } catch (SQLException e) {      log.error("try to close connection to database", e.fillInStackTrace());    }    boolean res = writeXmlFile(rfile, community_attrs, community_entities);    // Must close the file    try {      rfile.close();    } catch (IOException ioe) {}    return res;  }