package com.xmomen.module.export.model;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.multipart.MultipartHttpServletRequest;



public class UploadFileVo {
	private String byteField = "attachmentcontent";// 二进制文件内容保存到数据库的对应实体类字段
	private String titleField = "attachmenttitle";// 文件名(标题)保存到数据库的对应实体类字段
	private String basePath = "upload";// 文件保存目录根路径
	private String realPath = "realpath";// 文件保存在硬盘的全路径对应实体字段
	private String extend = "extend";// 扩展名
	private boolean view = false;// 是否是预览
	private boolean rename  =true;// 是否重命名
	private String swfpath;// 转换SWF
	private String cusPath;// 文件物理路径自定义子目录
	private byte[] content;// 预览或下载时传入的文件二进制内容
	private Object object;// 文件对应实体对象
	private String fileKey;// 上传文件ID
	private MultipartHttpServletRequest multipartRequest;
	private HttpServletRequest request;
	private HttpServletResponse response;

	public void setResponse(HttpServletResponse response) {
		this.response = response;
	}

	// 构造函数，传入HttpServletRequest和Object对象
	public UploadFileVo(HttpServletRequest request, Object object) {
			this.multipartRequest = (MultipartHttpServletRequest) request;
			this.object = object;
	}

	// 构造函数，传入HttpServletRequest对象
	public UploadFileVo(HttpServletRequest request) {
		this.multipartRequest = (MultipartHttpServletRequest) request;

	}

	// 构造函数，传入HttpServletRequest和HttpServletResponse对象
	public UploadFileVo(HttpServletRequest request, HttpServletResponse response) {
		this.request = request;
		this.response = response;
	}

	// 无参构造函数
	public UploadFileVo() {

	}

	// 获取swfpath
	public String getSwfpath() {
		return swfpath;
	}

	// 设置swfpath
	public void setSwfpath(String swfpath) {
		this.swfpath = swfpath;
	}

	// 获取realPath
	public String getRealPath() {
		return realPath;
	}

	// 设置realPath
	public void setRealPath(String realPath) {
		this.realPath = realPath;
	}

	// 获取response
	public HttpServletResponse getResponse() {
		return response;
	}

	// 获取request
	public HttpServletRequest getRequest() {
		return request;
	}

	// 设置request
	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}

	// 获取multipartRequest
	public MultipartHttpServletRequest getMultipartRequest() {
		return multipartRequest;
	}

	// 获取参数
	public String get(String name) {
		return getMultipartRequest().getParameter(name);

	}

	// 设置multipartRequest
	public void setMultipartRequest(MultipartHttpServletRequest multipartRequest) {
		this.multipartRequest = multipartRequest;
	}

	// 获取object
	public Object getObject() {
		return object;
	}

	// 获取basePath
	public String getBasePath() {
		return basePath;
	}

	// 设置basePath
	public void setBasePath(String basePath) {
		this.basePath = basePath;
	}

	// 设置object
	public void setObject(Object object) {
		this.object = object;
	}

	// 获取byteField
	public String getByteField() {
		return byteField;
	}

	// 设置byteField
	public void setByteField(String byteField) {
		this.byteField = byteField;
	}

	// 获取titleField
	public String getTitleField() {
		return titleField;
	}

	// 设置titleField
	public void setTitleField(String titleField) {
		this.titleField = titleField;
	}

	// 获取cusPath
	public String getCusPath() {
		return cusPath;
	}

	// 设置cusPath
	public void setCusPath(String cusPath) {
		this.cusPath = cusPath;
	}

	// 获取extend
	public String getExtend() {
		return extend;
	}

	// 设置extend
	public void setExtend(String extend) {
		this.extend = extend;
	}

	// 获取view
	public boolean isView() {
		return view;
	}

	// 设置view
	public void setView(boolean view) {
		this.view = view;
	}

	// 获取content
	public byte[] getContent() {
		return content;
	}

	// 设置content
	public void setContent(byte[] content) {
		this.content = content;
	}

	// 获取fileKey
	public String getFileKey() {
		return fileKey;
	}

	// 设置fileKey
	public void setFileKey(String fileKey) {
		this.fileKey = fileKey;
	}
	// 获取rename
	public boolean isRename() {
		return rename;
	}

	// 设置rename
	public void setRename(boolean rename) {
		this.rename = rename;
	}

}
