package froala.editor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.ArrayUtils;
import egovframework.rte.fdl.cmmn.exception.EgovBizException;
import froala.editor.image.ImageOptions;
import froala.editor.image.ImageValidation;
/**
* Image functionality.
*
* @author florin@froala.com
*/
public final class Image {
/**
* Private constructor.
*/
private Image() {
}
/**
* File default options.
*/
public static final ImageOptions defaultOptions = new ImageOptions();
/**
* Uploads an image to disk.
*
* @param req
* Servlet HTTP request.
* @param fileRoute
* Route Server route where the file will be uploaded. This route
* must be public to be accesed by the editor.
* @return Object with link.
* @throws EgovBizException
*/
public static EditorFileVO upload(HttpServletRequest req, String fileRoute) throws EgovBizException {
return upload(req, fileRoute, defaultOptions);
}
/**
* Uploads an image to disk.
*
* @param req
* Servlet HTTP request.
* @param fileRoute
* Server route where the file will be uploaded. This route must
* be public to be accesed by the editor.
* @param options
* Image options. Defaults to {@link #defaultOptions} which has
*
* Fieldname: "file"
* Validation:
*