// Path: src/main/java/org/mockenize/model/MultipleMockBean.java
// @Data
// @EqualsAndHashCode(callSuper = true)
// public class MultipleMockBean extends MockBean {
// 
// 	private List<MockBean> values = Collections.emptyList();
// 
// 	private boolean random;
// 
// 	private int lastIndexResponse = -1;
// 
// 	public int nextIndex() {
// 		if (++lastIndexResponse >= values.size()) {
// 			lastIndexResponse = 0;
// 		}
// 		return lastIndexResponse;
// 	}
// 
// 	public List<MockBean> getValues() {
// 		if (!values.isEmpty()) {
// 			for (MockBean mockBean : values) {
// 				mockBean.setMethod(getMethod());
// 				mockBean.setPath(getPath());
// 			}
// 		}
// 		return this.values;
// 	}
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mockenize.model.MultipleMockBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.io.CharStreams;
package org.mockenize.service;




@Service
public class FileService {
	
	@Autowired
	private MockService mockService;
	
	@Autowired
	private ObjectMapper mapper = new ObjectMapper();

	private Log log = LogFactory.getLog(getClass());

	public void loadFile(File file) {
		if (file != null && file.exists()) {
			if (file.isFile() && file.canRead()) {
				try (FileInputStream fileInputStream = new FileInputStream(file)) {
					String json = CharStreams.toString(new InputStreamReader(fileInputStream));
					read(json);
				} catch (IOException e) {
					log.error(e);
				}
			} else {
				for (File f : file.listFiles()) {
					loadFile(f);
				}
			}
		}
	}
	
// Path: src/main/java/org/mockenize/model/MultipleMockBean.java
// @Data
// @EqualsAndHashCode(callSuper = true)
// public class MultipleMockBean extends MockBean {
// 
// 	private List<MockBean> values = Collections.emptyList();
// 
// 	private boolean random;
// 
// 	private int lastIndexResponse = -1;
// 
// 	public int nextIndex() {
// 		if (++lastIndexResponse >= values.size()) {
// 			lastIndexResponse = 0;
// 		}
// 		return lastIndexResponse;
// 	}
// 
// 	public List<MockBean> getValues() {
// 		if (!values.isEmpty()) {
// 			for (MockBean mockBean : values) {
// 				mockBean.setMethod(getMethod());
// 				mockBean.setPath(getPath());
// 			}
// 		}
// 		return this.values;
// 	}
// }


// Path: src/main/java/org/mockenize/service/FileService.java
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mockenize.model.MultipleMockBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.io.CharStreams;

package org.mockenize.service;




@Service
public class FileService {
	
	@Autowired
	private MockService mockService;
	
	@Autowired
	private ObjectMapper mapper = new ObjectMapper();

	private Log log = LogFactory.getLog(getClass());

	public void loadFile(File file) {
		if (file != null && file.exists()) {
			if (file.isFile() && file.canRead()) {
				try (FileInputStream fileInputStream = new FileInputStream(file)) {
					String json = CharStreams.toString(new InputStreamReader(fileInputStream));
					read(json);
				} catch (IOException e) {
					log.error(e);
				}
			} else {
				for (File f : file.listFiles()) {
					loadFile(f);
				}
			}
		}
	}
	
	public Collection<MultipleMockBean> loadFile(InputStream fileInputStream) throws IOException {