Shop/src/action/index/EditUpload.java

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package action.index;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import util.DateUtil;

public class EditUpload extends BasicIndex{
	public File upload;
    public String proPicPath;
    public String uploadFileName;
    public String uploadContentType;

    public EditUpload()
    {
    }

    public String execute()
    {
        proPicPath = doFileexecute();
        proPicPath = (new StringBuilder("http://")).append(ServletActionContext.getRequest().getServerName()).append(":").append(ServletActionContext.getRequest().getServerPort()).append(proPicPath).toString();
        return "success";
    }

    public String doFileexecute()
    {
        Calendar c;
        SimpleDateFormat format;
        if(upload == null || upload.length() < 0L)
        {
            return "";
        }
        c = Calendar.getInstance();
        format = new SimpleDateFormat("yyyyMM");

        File f = new File(ServletActionContext.getServletContext().getRealPath(proPicPath));
        if(!f.exists())
        {
            f.mkdirs();
        }
        c = null;
        proPicPath = (new StringBuilder(String.valueOf(proPicPath))).append("/").append(DateUtil.builderTradeNo()).append(uploadFileName.substring(uploadFileName.lastIndexOf("."))).toString();
        upload.renameTo(new File(ServletActionContext.getServletContext().getRealPath(proPicPath)));
        return proPicPath;
    }

    public String getProPicPath()
    {
        return proPicPath;
    }

    public void setProPicPath(String proPicPath)
    {
        this.proPicPath = proPicPath;
    }

    public File getUpload()
后面还有 29 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。