@@ -0,0 +1,2065 @@
+package com.ecjtu.sharebox.server.impl.servlet;%0A%0Aimport org.ecjtu.easyserver.http.HTTPRequest;%0Aimport org.ecjtu.easyserver.http.HTTPResponse;%0Aimport org.ecjtu.easyserver.http.HTTPStatus;%0Aimport org.ecjtu.easyserver.servlet.BaseServlet;%0Aimport org.ecjtu.easyserver.util.FileUtil;%0A%0Aimport java.io.FileInputStream;%0Aimport java.io.IOException;%0Aimport java.net.MalformedURLException;%0Aimport java.io.File;%0A/**%0A * Created by KerriGan on 2017/7/12.%0A */%0A%0Apublic class Icon implements BaseServlet %7B%0A%0A    private static String sPath=%22%22;%0A%0A    public static void initPath(String path) %7B%0A        sPath=path;%0A    %7D%0A%0A    @Override%0A    public void doGet(HTTPRequest httpReq, HTTPResponse httpRes) %7B%0A//        String uri = httpReq.getURI();%0A//        String filePaths = uri.substring(%22/API/Icon%22.length());%0A//        int indexOf = filePaths.indexOf(%22&%22);%0A//%0A//        if (indexOf != -1) %7B%0A//            filePaths = filePaths.substring(0, indexOf);%0A//        %7D%0A%0A        try %7B%0A            File file = new File(sPath);%0A%0A            long contentLen = file.length();%0A%0A            String contentType = FileUtil.getFileType(sPath);%0A%0A            FileInputStream contentIn = new FileInputStream(file);%0A%0A            if (contentLen %3C= 0 %7C%7C contentType.length() %3C= 0%0A                    %7C%7C contentIn == null) %7B%0A                httpReq.returnBadRequest();%0A                return;%0A            %7D%0A%0A%0A            httpRes.setContentType(contentType);%0A            httpRes.setStatusCode(HTTPStatus.OK);%0A            httpRes.setContentLength(contentLen);%0A            httpRes.setContentInputStream(contentIn);%0A%0A            httpReq.post(httpRes);%0A%0A            contentIn.close();%0A        %7D catch (MalformedURLException e) %7B%0A            httpReq.returnBadRequest();%0A            return;%0A        %7D catch (IOException e) %7B%0A            httpReq.returnBadRequest();%0A            return;%0A        %7D catch (Exception e) %7B%0A            httpReq.returnBadRequest();%0A            return;%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void doPost(HTTPRequest httpReq, HTTPResponse httpRes) %7B%0A        doGet(httpReq,httpRes);%0A    %7D%0A%7D%0A

add Icon Servlet