com.gomcarter.frameworks.xmlexcel.utils.CsvUtils Maven / Gradle / Ivy
package com.gomcarter.frameworks.xmlexcel.utils;
import com.gomcarter.frameworks.xmlexcel.config.Header;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 生成csv文件
*
* @author gomcarter 2017年12月2日 08:10:35
*/
public class CsvUtils {
private static final String BOM_TAG;
private static final String SPLIT = "\t";
static {
BOM_TAG = new String(new byte[]{(byte) -17, (byte) -69, (byte) -65}, Charset.defaultCharset());
}
/**
* @param savePath savePath
* @param headers headers
* @param cells cells
* @throws IOException IOException
*/
public static void appendCsv(String savePath, List headers, List