package com.baidu.ueditor.extend;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.baidu.ueditor.define.State;
public class UEUploader {
private HttpServletRequest request = null;
private Map<String, Object> conf = null;
private UeditorService ueditorService = null;
public UEUploader(HttpServletRequest request, Map<String, Object> conf, UeditorService ueditorService) {
this.request = request;
this.conf = conf;
this.ueditorService = ueditorService;
}
public final State doExec() {
String filedName = (String) conf.get("fieldName");
State state = null;
if ("true".equals(this.conf.get("isBase64"))) {
// state = Base64Uploader.save(this.request, this.conf);
state = UEBase64Uploader.save(this.request.getParameter(filedName), this.conf, this.ueditorService);
} else {
// state = BinaryUploader.save(this.request, this.conf);
state = UEBinaryUploader.save(this.request, this.conf, this.ueditorService);
}
return state;
}
}
-
liqin authoredf224b1bd