// Path: src/main/java/com/tkhoon/framework/Constant.java
// public interface Constant {
// 
//     String DEFAULT_CHARSET = "UTF-8";
// 
//     String APP_HOME_PAGE = "app.home_page";
//     String APP_JSP_PATH = "app.jsp_path";
//     String APP_WWW_PATH = "app.www_path";
// 
//     String SERVLET_DEFAULT = "default";
//     String SERVLET_JSP = "jsp";
//     String SERVLET_UPLOAD = "upload";
// 
//     String REQUEST_FAVICON = "/favicon.ico";
//     String REQUEST_UPLOAD = "/upload.do";
// 
//     String UPLOAD_BASE_PATH = "upload/";
//     String UPLOAD_PATH_NAME = "path";
//     String UPLOAD_INPUT_NAME = "file";
//     String UPLOAD_FILE_NAME = "file_name";
//     String UPLOAD_FILE_TYPE = "file_type";
//     String UPLOAD_FILE_SIZE = "file_size";
// 
//     String PLUGIN_PACKAGE = "com.tkhoon.plugin";
// }


import com.tkhoon.framework.Constant;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
            logger.error("删除文件出错！", e);
            throw new RuntimeException(e);
        }
    }

    private static void checkDir(File src) {
        if (!src.exists()) {
            throw new RuntimeException("该路径不存在！" + src);
        }
        if (!src.isDirectory()) {
            throw new RuntimeException("该路径不是目录！");
        }
    }

    private static void checkFile(File src) {
        if (!src.exists()) {
            throw new RuntimeException("该路径不存在！" + src);
        }
        if (!src.isFile()) {
            throw new RuntimeException("该路径不是文件！");
        }
    }

    // 将字符串写入文件
    public static void writeFile(String filePath, String fileContent) {
        OutputStream os = null;
        Writer w = null;
        try {
            FileUtil.createFile(filePath);
            os = new BufferedOutputStream(new FileOutputStream(filePath));
// Path: src/main/java/com/tkhoon/framework/Constant.java
// public interface Constant {
// 
//     String DEFAULT_CHARSET = "UTF-8";
// 
//     String APP_HOME_PAGE = "app.home_page";
//     String APP_JSP_PATH = "app.jsp_path";
//     String APP_WWW_PATH = "app.www_path";
// 
//     String SERVLET_DEFAULT = "default";
//     String SERVLET_JSP = "jsp";
//     String SERVLET_UPLOAD = "upload";
// 
//     String REQUEST_FAVICON = "/favicon.ico";
//     String REQUEST_UPLOAD = "/upload.do";
// 
//     String UPLOAD_BASE_PATH = "upload/";
//     String UPLOAD_PATH_NAME = "path";
//     String UPLOAD_INPUT_NAME = "file";
//     String UPLOAD_FILE_NAME = "file_name";
//     String UPLOAD_FILE_TYPE = "file_type";
//     String UPLOAD_FILE_SIZE = "file_size";
// 
//     String PLUGIN_PACKAGE = "com.tkhoon.plugin";
// }


// Path: src/main/java/com/tkhoon/framework/util/FileUtil.java
import com.tkhoon.framework.Constant;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;

            logger.error("删除文件出错！", e);
            throw new RuntimeException(e);
        }
    }

    private static void checkDir(File src) {
        if (!src.exists()) {
            throw new RuntimeException("该路径不存在！" + src);
        }
        if (!src.isDirectory()) {
            throw new RuntimeException("该路径不是目录！");
        }
    }

    private static void checkFile(File src) {
        if (!src.exists()) {
            throw new RuntimeException("该路径不存在！" + src);
        }
        if (!src.isFile()) {
            throw new RuntimeException("该路径不是文件！");
        }
    }

    // 将字符串写入文件
    public static void writeFile(String filePath, String fileContent) {
        OutputStream os = null;
        Writer w = null;
        try {
            FileUtil.createFile(filePath);
            os = new BufferedOutputStream(new FileOutputStream(filePath));
            w = new OutputStreamWriter(os, Constant.DEFAULT_CHARSET);