Package ef.api

Examples of ef.api.ErrException


    @Override
    public String getRequiredString(String paramName) {
        String param = request.getParameter(paramName);
        if(StringUtils.isEmpty(param) || param.equalsIgnoreCase("null")){
            throw new ErrException(Error.errCmdParams, paramName);
        }
        return param;
    }
View Full Code Here


    @Override
    public String[] getRequiredStringArray(String paramName) {
        String[] values = request.getParameterValues(paramName);
        if(values == null || values.length == 0){
            throw new ErrException(Error.errCmdParams, paramName);
        }
        return values;
    }
View Full Code Here

    public long getRequiredLong(String paramName) {
        String param = getRequiredString(paramName);
        try {
            return Long.valueOf(param);
        } catch (NumberFormatException e) {
            throw new ErrException(Error.errCmdParams, paramName);
        }
    }
View Full Code Here

        try {
            parsedUpload = fileUpload.parseParameterMap(request);
            return (Map<String, List<FileItem>>) parsedUpload;
        } catch (FileUploadException e) {
            if(e instanceof FileUploadBase.FileSizeLimitExceededException){
                parsedUpload = new ErrException(e, Error.errFileMaxSize, "Allowed size is "+fileUpload.getFileSizeMax() / 1024 + " Kb");
            }else
            if(e instanceof FileUploadBase.InvalidContentTypeException){
                parsedUpload =  new ErrException(e, Error.errUploadMime);
            }else
            if(e instanceof FileUploadBase.IOFileUploadException){
                parsedUpload =  new ErrException(e, Error.errUploadTransfer);
            }else{
                parsedUpload =  new ErrException(e, Error.errUploadCommon);
            }

            throw (ErrException) parsedUpload;
        }
    }
View Full Code Here

    @Override
    public String getRequiredUploadString(String paramName) {
        List<FileItem> items = getFileUpload().get(paramName);
        if(items == null || items.isEmpty()){
            throw new ErrException(Error.errCmdParams, paramName);
        }

        FileItem item = items.get(0);
        if(!item.isFormField()){
            throw new ErrException(Error.errCmdParams, paramName);
        }
        return item.getString();
    }
View Full Code Here

TOP

Related Classes of ef.api.ErrException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.