Here you can find the source of parseDOMConfigFile(String folderPath, String configFileName)
public static Document parseDOMConfigFile(String folderPath, String configFileName) throws Exception
//package com.java2s; /******************************************************************************* * Copyright (c) 2006-2010 eBay Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 *******************************************************************************/ import java.io.File; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; public class Main { public static Document parseDOMConfigFile(String folderPath, String configFileName) throws Exception { File clientConfigFile = new File(folderPath, configFileName); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); return builder.parse(clientConfigFile); }// w w w .j a va2 s. c o m }