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

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.Reader;
import java.util.Map;
import java.util.Properties;

import jline.internal.InputStreamReader;

import com.dangdang.config.service.exception.InvalidPathException;
import com.google.common.collect.Maps;

/**
 * @author <a href="mailto:wangyuxuan@dangdang.com">Yuxuan Wang</a>
 *
 */
public class PropertiesContentType implements ContentType {

	@Override
	public Map<String, String> resolve(byte[] data, String encoding) throws InvalidPathException {
		Properties props = new Properties();
		try (Reader reader = new InputStreamReader(new ByteArrayInputStream(data), encoding)) {
			props.load(reader);
		} catch (IOException e) {
			throw new InvalidPathException(e);
		}

		return Maps.fromProperties(props);
	}

}

@@ -109,24 +109,58 @@
 OException;%0A
+import java.io.InputStreamReader;%0A
 import java.
@@ -226,50 +226,8 @@
 s;%0A%0A
-import jline.internal.InputStreamReader;%0A%0A
 impo

replace InputStreamReader with jdk internal class