com.leazxl.cms.service.ueditor.upload.Uploader Maven / Gradle / Ivy
package com.leazxl.cms.service.ueditor.upload;
import com.leazxl.cms.service.ueditor.define.State;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
public class Uploader {
private HttpServletRequest request = null;
private Map conf = null;
public Uploader(HttpServletRequest request, Map conf) {
this.request = request;
this.conf = conf;
}
public final State doExec() {
String filedName = (String) this.conf.get("fieldName");
State state = null;
if ("true".equals(this.conf.get("isBase64"))) {
state = Base64Uploader.save(this.request.getParameter(filedName),
this.conf);
} else {
state = BinaryMVCUploader.save(this.request, this.conf);
}
return state;
}
}