// Path: src/main/java/t5750/poi/service/ExcelService.java
// public interface ExcelService {
// 	List<List<Object>> readExcel(File file) throws IOException;
// 
// 	List<List<Object>> readExcel(InputStream is, String suffix)
// 			throws IOException;
// 
// 	void download(String filename, InputStream is, HttpServletResponse response)
// 			throws IOException;
// 
// 	void download(String filename, String path, HttpServletResponse response)
// 			throws IOException;
// 
// 	String export2003(String fileName, HttpServletResponse response)
// 			throws IOException;
// 
// 	String export2007(String fileName, HttpServletResponse response)
// 			throws IOException;
// 
// 	String template(String fileName, HttpServletResponse response)
// 			throws IOException;
// 
// 	String replace(String fileName, HttpServletResponse response)
// 			throws IOException;
// }
// 
// Path: src/main/java/t5750/poi/util/Globals.java
// public class Globals {
// 	public static final String DOC = "doc";
// 	public static final String IMG = "img";
// 	public static final String DOC_PATH = ClassLoaderUtil.getClassPath()
// 			+ File.separator + DOC;
// 	public static final String IMG_PATH = ClassLoaderUtil.getClassPath()
// 			+ File.separator + IMG;
// 	public static final String SUFFIX_XLS = ".xls";
// 	public static final String SUFFIX_XLSX = ".xlsx";
// 	public static final String SUFFIX_PNG = ".png";
// 	public static final String EXPORT_STUDENT = "student"
// 			+ System.currentTimeMillis() + SUFFIX_XLS;
// 	public static final String EXPORT_BOOK = "book"
// 			+ System.currentTimeMillis() + SUFFIX_XLS;
// 	public static final String EXPORT_2007 = "export2007中文_"
// 			+ System.currentTimeMillis() + SUFFIX_XLSX;
// 	public static final String EXPORT_PRODUCT = "product"
// 			+ System.currentTimeMillis() + SUFFIX_XLS;
// 	public static final String SHEETNAME = "测试POI导出EXCEL文档";
// 
// 	public static String getBasePath(HttpServletRequest request) {
// 		String path = request.getContextPath();
// 		String basePath = request.getScheme() + "://" + request.getServerName()
// 				+ ":" + request.getServerPort() + path + "/";
// 		return basePath;
// 	}
// }


import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import t5750.poi.service.ExcelService;
import t5750.poi.util.Globals;
package t5750.poi.controller;



@RestController
@RequestMapping("/excel")
public class ExcelController {
	@Autowired
	private ExcelService excelService;
	@Autowired
	private HttpServletResponse response;

	@RequestMapping(value = "/read/{fileName}", method = RequestMethod.GET)
	public List read(@PathVariable String fileName) throws IOException {
		Resource resource = new ClassPathResource(
// Path: src/main/java/t5750/poi/service/ExcelService.java
// public interface ExcelService {
// 	List<List<Object>> readExcel(File file) throws IOException;
// 
// 	List<List<Object>> readExcel(InputStream is, String suffix)
// 			throws IOException;
// 
// 	void download(String filename, InputStream is, HttpServletResponse response)
// 			throws IOException;
// 
// 	void download(String filename, String path, HttpServletResponse response)
// 			throws IOException;
// 
// 	String export2003(String fileName, HttpServletResponse response)
// 			throws IOException;
// 
// 	String export2007(String fileName, HttpServletResponse response)
// 			throws IOException;
// 
// 	String template(String fileName, HttpServletResponse response)
// 			throws IOException;
// 
// 	String replace(String fileName, HttpServletResponse response)
// 			throws IOException;
// }
// 
// Path: src/main/java/t5750/poi/util/Globals.java
// public class Globals {
// 	public static final String DOC = "doc";
// 	public static final String IMG = "img";
// 	public static final String DOC_PATH = ClassLoaderUtil.getClassPath()
// 			+ File.separator + DOC;
// 	public static final String IMG_PATH = ClassLoaderUtil.getClassPath()
// 			+ File.separator + IMG;
// 	public static final String SUFFIX_XLS = ".xls";
// 	public static final String SUFFIX_XLSX = ".xlsx";
// 	public static final String SUFFIX_PNG = ".png";
// 	public static final String EXPORT_STUDENT = "student"
// 			+ System.currentTimeMillis() + SUFFIX_XLS;
// 	public static final String EXPORT_BOOK = "book"
// 			+ System.currentTimeMillis() + SUFFIX_XLS;
// 	public static final String EXPORT_2007 = "export2007中文_"
// 			+ System.currentTimeMillis() + SUFFIX_XLSX;
// 	public static final String EXPORT_PRODUCT = "product"
// 			+ System.currentTimeMillis() + SUFFIX_XLS;
// 	public static final String SHEETNAME = "测试POI导出EXCEL文档";
// 
// 	public static String getBasePath(HttpServletRequest request) {
// 		String path = request.getContextPath();
// 		String basePath = request.getScheme() + "://" + request.getServerName()
// 				+ ":" + request.getServerPort() + path + "/";
// 		return basePath;
// 	}
// }


// Path: src/main/java/t5750/poi/controller/ExcelController.java
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import t5750.poi.service.ExcelService;
import t5750.poi.util.Globals;

package t5750.poi.controller;



@RestController
@RequestMapping("/excel")
public class ExcelController {
	@Autowired
	private ExcelService excelService;
	@Autowired
	private HttpServletResponse response;

	@RequestMapping(value = "/read/{fileName}", method = RequestMethod.GET)
	public List read(@PathVariable String fileName) throws IOException {
		Resource resource = new ClassPathResource(
				Globals.DOC + File.separator + fileName + Globals.SUFFIX_XLS);