// Path: config-toolkit/src/main/java/com/dangdang/config/service/exception/InvalidPathException.java
// public class InvalidPathException extends ConfigToolkitException {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	public InvalidPathException() {
// 		super();
// 	}
// 
// 	public InvalidPathException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	public InvalidPathException(String message) {
// 		super(message);
// 	}
// 
// 	public InvalidPathException(Throwable cause) {
// 		super(cause);
// 	}
// 
// }


import com.dangdang.config.service.exception.InvalidPathException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
package com.dangdang.config.service.file.contenttype;



/**
 * <p>
 * The XML document must have the following DOCTYPE declaration:
 * 
 * <pre>
 * &lt;!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"&gt;
 * </pre>
 * 
 * Furthermore, the document must satisfy the properties DTD described above.
 * 
 * @author <a href="mailto:wangyuxuan@dangdang.com">Yuxuan Wang</a>
 *
 */
public class XmlContentType implements ContentType {

	@Override
	public Map<String, String> resolve(byte[] data, String encoding) throws InvalidPathException {
		Properties props = new Properties();
// Path: config-toolkit/src/main/java/com/dangdang/config/service/exception/InvalidPathException.java
// public class InvalidPathException extends ConfigToolkitException {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	public InvalidPathException() {
// 		super();
// 	}
// 
// 	public InvalidPathException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	public InvalidPathException(String message) {
// 		super(message);
// 	}
// 
// 	public InvalidPathException(Throwable cause) {
// 		super(cause);
// 	}
// 
// }


// Path: config-toolkit/src/main/java/com/dangdang/config/service/file/contenttype/XmlContentType.java
import com.dangdang.config.service.exception.InvalidPathException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

package com.dangdang.config.service.file.contenttype;



/**
 * <p>
 * The XML document must have the following DOCTYPE declaration:
 * 
 * <pre>
 * &lt;!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"&gt;
 * </pre>
 * 
 * Furthermore, the document must satisfy the properties DTD described above.
 * 
 * @author <a href="mailto:wangyuxuan@dangdang.com">Yuxuan Wang</a>
 *
 */
public class XmlContentType implements ContentType {

	@Override
	public Map<String, String> resolve(byte[] data, String encoding) throws InvalidPathException {
		Properties props = new Properties();
		try (InputStream in = new ByteArrayInputStream(data)) {