// Path: src/main/java/org/erc/qmm/util/FileUtils.java
// public abstract class FileUtils {
// 	
// 	/**
// 	 * Copy.
// 	 *
// 	 * @param source the source
// 	 * @param dest the dest
// 	 * @throws IOException Signals that an I/O exception has occurred.
// 	 */
// 	public static void copy(File source, File dest) throws IOException {
// 	    InputStream is = null;
// 	    OutputStream os = null;
// 	    try {
// 	        is = new FileInputStream(source);
// 	        os = new FileOutputStream(dest);
// 	        byte[] buffer = new byte[1024];
// 	        int length;
// 	        while ((length = is.read(buffer)) > 0) {
// 	            os.write(buffer, 0, length);
// 	        }
// 	    } finally {
// 	        is.close();
// 	        os.close();
// 	    }
// 	}
// 	
// 	/**
// 	 * Store.
// 	 *
// 	 * @param file the file
// 	 * @param content the content
// 	 * @throws IOException Signals that an I/O exception has occurred.
// 	 */
// 	public static void store(File file,String content) throws IOException{
// 		BufferedWriter bw = new BufferedWriter(new FileWriter(file.getAbsoluteFile()));
// 		bw.write(content);
// 		bw.close();
// 	}
// 	
// }


import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.erc.qmm.util.FileUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
				Node node = queuesList.item(i);
				if (node.getNodeType() == Node.ELEMENT_NODE) {
					Element eElement = (Element) node;
					QueueConfig queue = new QueueConfig();
					queue.setDesc(eElement.getAttribute("desc"));
					queue.setHost(getText(eElement,"host"));
					queue.setPort(getInt(eElement,"port"));
					queue.setPollTime(getInt(eElement,"poll"));
					queue.setManager(getText(eElement,"manager"));
					queue.setChannel(getText(eElement,"channel"));
					queue.setName(getText(eElement,"name"));
					queue.setActive(getBool(eElement,"active",true));
					items.add(queue);
				}
			}
		}
		return items;
	}
	
	/**
	 * Save queues.
	 *
	 * @param queues the queues
	 * @throws IOException Signals that an I/O exception has occurred.
	 */
	public void saveQueues(List<QueueConfig> queues) throws IOException{
		File xmlFile = new File("config/config.xml");
		File configFilder = new File("config");
		
		if(xmlFile.exists()){
// Path: src/main/java/org/erc/qmm/util/FileUtils.java
// public abstract class FileUtils {
// 	
// 	/**
// 	 * Copy.
// 	 *
// 	 * @param source the source
// 	 * @param dest the dest
// 	 * @throws IOException Signals that an I/O exception has occurred.
// 	 */
// 	public static void copy(File source, File dest) throws IOException {
// 	    InputStream is = null;
// 	    OutputStream os = null;
// 	    try {
// 	        is = new FileInputStream(source);
// 	        os = new FileOutputStream(dest);
// 	        byte[] buffer = new byte[1024];
// 	        int length;
// 	        while ((length = is.read(buffer)) > 0) {
// 	            os.write(buffer, 0, length);
// 	        }
// 	    } finally {
// 	        is.close();
// 	        os.close();
// 	    }
// 	}
// 	
// 	/**
// 	 * Store.
// 	 *
// 	 * @param file the file
// 	 * @param content the content
// 	 * @throws IOException Signals that an I/O exception has occurred.
// 	 */
// 	public static void store(File file,String content) throws IOException{
// 		BufferedWriter bw = new BufferedWriter(new FileWriter(file.getAbsoluteFile()));
// 		bw.write(content);
// 		bw.close();
// 	}
// 	
// }


// Path: src/main/java/org/erc/qmm/config/ConfigManager.java
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.erc.qmm.util.FileUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

				Node node = queuesList.item(i);
				if (node.getNodeType() == Node.ELEMENT_NODE) {
					Element eElement = (Element) node;
					QueueConfig queue = new QueueConfig();
					queue.setDesc(eElement.getAttribute("desc"));
					queue.setHost(getText(eElement,"host"));
					queue.setPort(getInt(eElement,"port"));
					queue.setPollTime(getInt(eElement,"poll"));
					queue.setManager(getText(eElement,"manager"));
					queue.setChannel(getText(eElement,"channel"));
					queue.setName(getText(eElement,"name"));
					queue.setActive(getBool(eElement,"active",true));
					items.add(queue);
				}
			}
		}
		return items;
	}
	
	/**
	 * Save queues.
	 *
	 * @param queues the queues
	 * @throws IOException Signals that an I/O exception has occurred.
	 */
	public void saveQueues(List<QueueConfig> queues) throws IOException{
		File xmlFile = new File("config/config.xml");
		File configFilder = new File("config");
		
		if(xmlFile.exists()){
			FileUtils.copy(xmlFile, new File("config/config.xml.bak"));