Example usage for org.apache.commons.fileupload FileUploadException getMessage

List of usage examples for org.apache.commons.fileupload FileUploadException getMessage

Introduction

In this page you can find the example usage for org.apache.commons.fileupload FileUploadException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.vosao.servlet.FormSendServlet.java

public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

    String message = null;// w w w .  j  a v a  2s .com
    Map<String, String> parameters = new HashMap<String, String>();
    List<FileItem> files = new ArrayList<FileItem>();
    try {
        if (request.getContentType().startsWith("multipart/form-data")) {
            ServletFileUpload upload = new ServletFileUpload();
            upload.setFileSizeMax(MAX_SIZE);
            upload.setHeaderEncoding("UTF-8");
            FileItemIterator iter;
            try {
                iter = upload.getItemIterator(request);
                InputStream stream = null;
                while (iter.hasNext()) {
                    FileItemStream item = iter.next();
                    stream = item.openStream();
                    if (item.isFormField()) {
                        parameters.put(item.getFieldName(), Streams.asString(stream, "UTF-8"));
                    } else {
                        files.add(new FileItem(item, StreamUtil.readFileStream(stream)));
                    }
                }
            } catch (FileUploadException e) {
                logger.error(e.getMessage());
                throw new UploadException(Messages.get("request_parsing_error"));
            }
        } else {
            for (Object key : request.getParameterMap().keySet()) {
                String paramName = (String) key;
                parameters.put(paramName, request.getParameter(paramName));
            }
        }
        message = processForm(parameters, files, request);
    } catch (UploadException e) {
        message = createMessage("error", e.getMessage());
        logger.error(message);
    } catch (Exception e) {
        message = createMessage("error", e.getMessage());
        logger.error(message);
        e.printStackTrace();
    }
    response.setContentType("text/html");
    response.setCharacterEncoding("UTF-8");
    response.setStatus(200);
    response.getWriter().write(message);
}

From source file:org.vosao.servlet.WebdavServletRequest.java

@Override
public void parseRequestParameters(Map<String, String> params, Map<String, com.bradmcevoy.http.FileItem> files)
        throws RequestParseException {
    try {//from w  w w  .jav a 2 s. c o m
        if (isMultiPart()) {
            ServletFileUpload upload = new ServletFileUpload();
            List<FileItem> items = upload.parseRequest(request);
            parseQueryString(params);
            for (FileItem item : items) {
                if (item.isFormField()) {
                    params.put(item.getFieldName(), item.getString());
                } else {
                    files.put(item.getFieldName(), new FileItemWrapper(item));
                }
            }
        } else {
            for (Enumeration en = request.getParameterNames(); en.hasMoreElements();) {
                String nm = (String) en.nextElement();
                String val = request.getParameter(nm);
                logger.debug("..param: " + nm + " = " + val);
                params.put(nm, val);
            }
        }
    } catch (FileUploadException ex) {
        throw new RequestParseException("FileUploadException", ex);
    } catch (Throwable ex) {
        throw new RequestParseException(ex.getMessage(), ex);
    }
}

From source file:org.wso2.carbon.reporting.custom.ui.upload.JrxmlFileUploadExecutor.java

public boolean execute(HttpServletRequest request, HttpServletResponse response)
        throws CarbonException, IOException {

    String webContext = (String) request.getAttribute(CarbonConstants.WEB_CONTEXT);
    String serverURL = (String) request.getAttribute(CarbonConstants.SERVER_URL);
    String cookie = (String) request.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
    boolean status = false;
    Map<String, ArrayList<FileItemData>> fileItemsMap = getFileItemsMap();
    Map<String, ArrayList<String>> formFieldsMap = getFormFieldsMap();

    if (fileItemsMap == null || fileItemsMap.isEmpty()) {
        String msg = "File uploading failed. No files are specified";
        log.error(msg);//from  ww w .j a  v  a  2 s . co m
        CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.ERROR, request, response,
                getContextRoot(request) + "/" + webContext + "/create-reports/list-reports.jsp");

        return false;
    }
    JrxmlFileUploaderClient uploaderClient = new JrxmlFileUploaderClient(cookie, serverURL,
            configurationContext);
    List<FileItemData> fileItems = fileItemsMap.get("upload");
    String errorRedirect = null;

    try {
        for (FileItemData fileItem : fileItems) {
            String filename = getFileName(fileItem.getFileItem().getName());
            try {
                checkServiceFileExtensionValidity(filename, ALLOWED_FILE_EXTENSIONS);
            } catch (FileUploadException e) {
                log.error("Failed to validate format of file : " + filename, e);
                throw e;
            }
            if (!filename.endsWith(".jrxml")) {
                throw new CarbonException("File with extension " + getFileName(fileItem.getFileItem().getName())
                        + " is not supported!");
            }
            String uploadStatue = uploaderClient.uploadJrxmlFile(filename.split(".jrxml")[0],
                    fileItem.getFileItem().getString());
            if (uploadStatue.equals("success")) {
                status = true;
            }
            response.setContentType("text/html; charset=utf-8");
            String msg = "Successfully uploaded jrxml file.";

            if (redirect == null) {
                CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.INFO, request);
                response.sendRedirect("../" + webContext
                        + "/reporting_custom/list-reports.jsp?region=region5&item=reporting_list");
            } else {
                response.sendRedirect("../" + webContext + "/" + redirect);
            }

        }
        return status;
    } catch (IOException e) {
        // This happens if an error occurs while sending the UI Error Message.
        String msg = "File upload failed. " + e.getMessage();
        log.error("File upload failed. ", e);

        if (errorRedirect == null) {
            CarbonUIMessage.sendCarbonUIMessage(msg, CarbonUIMessage.INFO, request);
            response.sendRedirect("../" + webContext + "/reporting_custom/list-reports.jsp");
        } else {
            response.sendRedirect(
                    "../" + webContext + "/" + errorRedirect + (errorRedirect.indexOf("?") == -1 ? "?" : "&")
                            + "msg=" + URLEncoder.encode(msg, "UTF-8"));
        }
        return false;
    } catch (RuntimeException e) {
        // we explicitly catch runtime exceptions too, since we want to make them available as
        // UI Errors in this scenario.
        String msg = "File upload failed. " + e.getMessage();
        log.error("File upload failed. ", e);
        buildUIError(request, response, webContext, errorRedirect, msg);
        return false;
    } catch (Exception e) {
        String msg = "File upload failed. " + e.getMessage();
        log.error("File upload failed. ", e);

        buildUIError(request, response, webContext, errorRedirect, msg);
        return status;
    }
}

From source file:org.xmlactions.web.PagerFilter.java

public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain chain)
        throws IOException, ServletException {
    logger.debug("PagerFilter.doFilter");

    MockHttpServletResponse mockResponse = new MockHttpServletResponse();
    PagerServlet pagerServlet = new PagerServlet();
    try {//from  w  ww .j a va2 s  .c  om
        pagerServlet.init(filterConfig);
        if (req instanceof HttpServletRequest && rsp instanceof HttpServletResponse) {
            pagerServlet.setupExecContext((HttpServletRequest) req, (HttpServletResponse) rsp);
        }
        chain.doFilter(req, mockResponse);
        RequestExecContext.remove();
    } catch (FileUploadException e) {
        throw new IllegalArgumentException(e.getMessage(), e);
    } finally {
        String page = mockResponse.getContentAsString();
        pagerServlet.processPageFromFilter(req, rsp, page);
    }
}

From source file:org.zanata.servlet.MultiFileUploadServlet.java

private void processMultipartPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
    FileUploadRequestHandler uploadRequestHandler = new FileUploadRequestHandler(request);
    JSONArray filesJson;/* ww w .  j  a v  a 2  s .c  o m*/
    try {
        filesJson = uploadRequestHandler.process();
    } catch (FileUploadException e) {
        respondWithError(response, "upload failed: " + e.getMessage());
        return;
    }
    respondWithFiles(response, filesJson);
}

From source file:sai_cas.servlet.CrossMatchServlet.java

public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, java.io.IOException {

    PrintWriter out = response.getWriter();

    String cat = null, tab = null, radString = null, raColumn = null, decColumn = null, formatString = null;
    formats format;/*from   w  w w .  j av a 2s  .  c  om*/

    List<FileItem> fileItemList = null;

    FileItemFactory factory = new DiskFileItemFactory();
    try {
        ServletFileUpload sfu = new ServletFileUpload(factory);
        sfu.setSizeMax(50000000);
        /* Request size <= 50Mb */
        fileItemList = sfu.parseRequest(request);

    } catch (FileUploadException e) {
        throw new ServletException(e.getMessage());
        /* Nothing ...*/
    }

    FileItem fi = null;

    for (FileItem fi0 : fileItemList) {
        if (fi0.getFieldName().equals("file"))//(!fi0.isFormField())
        {
            fi = fi0;
        }
        if (fi0.getFieldName().equals("tab"))//(!fi0.isFormField())
        {
            tab = fi0.getString();
        }
        if (fi0.getFieldName().equals("cat"))//(!fi0.isFormField())
        {
            cat = fi0.getString();
        }
        if (fi0.getFieldName().equals("rad"))//(!fi0.isFormField())
        {
            radString = fi0.getString();
        }
        if (fi0.getFieldName().equals("racol"))//(!fi0.isFormField())
        {
            raColumn = fi0.getString();
        }
        if (fi0.getFieldName().equals("deccol"))//(!fi0.isFormField())
        {
            decColumn = fi0.getString();
        }
        if (fi0.getFieldName().equals("format"))//(!fi0.isFormField())
        {
            formatString = fi0.getString();
        }
    }
    if ((formatString == null) || (formatString.equalsIgnoreCase("votable"))) {
        format = formats.VOTABLE;
    } else if (formatString.equalsIgnoreCase("CSV")) {
        format = formats.CSV;
    } else {
        format = formats.VOTABLE;
    }

    QueryResultsOutputter qro = null;
    CSVQueryResultsOutputter csvqro = null;
    VOTableQueryResultsOutputter voqro = null;
    switch (format) {
    case CSV:
        response.setContentType("text/csv");
        csvqro = new CSVQueryResultsOutputter(null);
        qro = csvqro;
        break;
    case VOTABLE:
        response.setContentType("text/xml");
        voqro = new VOTableQueryResultsOutputter();
        qro = voqro;
        break;
    }

    File uploadedFile = null;
    Connection conn = null;
    DBInterface dbi = null;

    try {
        double rad = 0;
        String inputFilename = fi.getName();
        rad = Double.parseDouble(radString);

        if (fi == null) {
            throw new CrossMatchServletException("File should be specified" + fileItemList.size());
        }
        long size = fi.getSize();

        if (size > 10000000) {
            throw new CrossMatchServletException("File is too big");
        }
        if (size == 0) {
            throw new CrossMatchServletException("File must not be empty");
        }

        if (format.equals(formats.CSV)) {
            if ((raColumn == null) || (decColumn == null)) {
                throw new CrossMatchServletException(
                        "When you use the CSV format, you must specify which columns contain RA and DEC");
            }
        }

        uploadedFile = File.createTempFile("crossmatch", ".dat", new File("/tmp/"));
        try {
            fi.write(uploadedFile);
        } catch (Exception e) {
            throw new CrossMatchServletException("Error in writing your data in the temporary file");
        }

        logger.debug("File written");
        String[] userPasswd = sai_cas.Parameters.getDefaultTempDBUserPasswd();
        String tempUser = userPasswd[0];
        String tempPasswd = userPasswd[1];
        conn = DBConnection.getPooledPerUserConnection(tempUser, tempPasswd);
        dbi = new DBInterface(conn, tempUser);
        Votable vot = null;
        switch (format) {
        case CSV:
            vot = Votable.getVOTableFromCSV(uploadedFile);
            if ((!vot.checkColumnExistance(raColumn)) || (!vot.checkColumnExistance(decColumn))) {
                throw new CrossMatchServletException(
                        "The column names specified as RA and DEC should be present in the CSV file");
            }
            break;
        case VOTABLE:
            vot = new Votable(uploadedFile);
            break;
        }
        vot.randomizeResourceName();
        vot.randomizeTableName();
        String userDataSchema = dbi.getUserDataSchemaName();
        String tableName = vot.insertDataToDB(dbi, userDataSchema);
        dbi.analyze(userDataSchema, tableName);
        String[] raDecArray = dbi.getRaDecColumns(cat, tab);
        String[] raDecArray1 = null;
        switch (format) {
        case VOTABLE:
            raDecArray1 = dbi.getRaDecColumnsFromUCD(userDataSchema, tableName);
            if (raDecArray1 == null) {
                throw new CrossMatchServletException("Error occured: "
                        + "You must have the columns in the table having the UCD of alpha or delta ('POS_EQ_RA_MAIN', 'POS_EQ_DEC_MAIN') to do the crossmatch");
            }
            break;
        case CSV:
            raDecArray1 = new String[2];
            raDecArray1[0] = raColumn;
            raDecArray1[1] = decColumn;
        }

        String outputFilename = cat + "." + (tab == null ? "" : tab) + "_"
                + String.format(Locale.US, "%.4f", rad) + "_" + inputFilename;

        response.setHeader("Content-Disposition", "attachment; filename=" + outputFilename);

        dbi.executeQuery("select * from " + userDataSchema + "." + tableName + " AS a LEFT JOIN " + cat + "."
                + tab + " AS b " + "ON q3c_join(a." + raDecArray1[0] + ",a." + raDecArray1[1] + ",b."
                + raDecArray[0] + ",b." + raDecArray[1] + "," + rad + ")");
        if (format.equals(formats.VOTABLE)) {
            voqro.setResource(cat + "_" + fi.getName());
            voqro.setResourceDescription("This is the table obtained by " + "crossmatching the table " + cat
                    + "." + tab + " with the " + "user supplied table from the file " + fi.getName() + "\n"
                    + "Radius of the crossmatch: " + rad + "deg");
            voqro.setTable("main");
        }
        qro.print(out, dbi);
    } catch (VotableException e) {
        qro.printError(out, "Error occured: " + e.getMessage()
                + "Cannot read the VOTable, probably it is not well formed (remember that you must have 'xmlns=\"http://www.ivoa.net/xml/VOTable/v1.1\"' in the VOTABLE tag)");
    } catch (NumberFormatException e) {
        qro.printError(out, "Error occured: " + e.getMessage());
    } catch (CrossMatchServletException e) {
        qro.printError(out, "Error occured: " + e.getMessage());
    } catch (DBException e) {
        logger.error("DBException " + e);
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        e.printStackTrace(pw);
        qro.printError(out, "Error occured: " + e + "\nCause: " + e.getCause() + "\nTrace: " + sw);
    } catch (SQLException e) {
        logger.error("SQLException " + e);
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        e.printStackTrace(pw);
        qro.printError(out, "Error occured: " + e + "\nCause: " + e.getCause() + "\nTrace: " + sw);
    } finally {
        DBInterface.close(dbi, conn, false);
        /* Always rollback */
        try {
            if (uploadedFile != null) {
                uploadedFile.delete();
            }
        } catch (Exception e) {
            logger.error("Failed to delete the temporary file: " + uploadedFile.getCanonicalPath());
        }
    }

}

From source file:sai_cas.servlet.UploadServlet.java

public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, java.io.IOException {

    PrintWriter out = response.getWriter();
    String user = null, password = null;
    String catalogString = null, formatString = null;
    File uploadedFile = null;/*from w w w . j av  a 2  s .  c  o  m*/
    Connection conn = null;
    DBInterface dbi = null;

    List<FileItem> fileItemList = null;

    FileItemFactory factory = new DiskFileItemFactory();
    try {
        ServletFileUpload sfu = new ServletFileUpload(factory);
        sfu.setSizeMax(50000000);
        /* Request size <= 50Mb */
        fileItemList = sfu.parseRequest(request);

    } catch (FileUploadException e) {
        throw new ServletException(e.getMessage());
        /* Nothing ...*/
    }

    FileItem fi = null;

    for (FileItem fi0 : fileItemList) {
        if (fi0.getFieldName().equals("file"))//(!fi0.isFormField())
        {
            fi = fi0;
        }
        if (fi0.getFieldName().equals("user"))//(!fi0.isFormField())
        {
            user = fi0.getString();
        }
        if (fi0.getFieldName().equals("password"))//(!fi0.isFormField())
        {
            password = fi0.getString();
        }
        /*         if (fi0.getFieldName().equals("rad"))//(!fi0.isFormField())
                 {
                    radString = fi0.getString();
                 }
                 if (fi0.getFieldName().equals("racol"))//(!fi0.isFormField())
                 {
                    raColumn = fi0.getString();
                 }
                 if (fi0.getFieldName().equals("deccol"))//(!fi0.isFormField())
                 {
                    decColumn = fi0.getString();
                 }
        */
        if (fi0.getFieldName().equals("format"))//(!fi0.isFormField())
        {
            formatString = fi0.getString();
        }
    }
    try {
        Votable vot;

        if (fi == null) {
            throw new ServletException("File must be specified" + fileItemList.size());
        }
        if (user == null) {
            throw new ServletException("User name must be specified" + fileItemList.size());
        }
        if (password == null) {
            throw new ServletException("Password must be specified" + fileItemList.size());
        }

        long size = fi.getSize();

        if (size > 10000000) {
            throw new UploadServletException("File is too big");
        }
        if (size == 0) {
            throw new UploadServletException("File must not be empty");
        }
        uploadedFile = File.createTempFile("crossmatch", ".dat", new File("/tmp/"));
        try {
            fi.write(uploadedFile);
        } catch (Exception e) {
            throw new UploadServletException("Error in writing your data in the temporary file");
        }

        logger.debug("File written");

        try {
            conn = DBConnection.getPooledPerUserConnection(user, password);
            dbi = new DBInterface(conn, user);
            String userDataSchema = dbi.getUserDataSchemaName();
            vot = new Votable(uploadedFile);
            vot.insertDataToDB(dbi, userDataSchema);
        } catch (SQLException e) {
            logger.error("Got an exception... ", e);
            throw new UploadServletException(e.getMessage());
        } catch (VotableException e) {
            logger.error("Got an Votable exception... ", e);
            throw new UploadServletException(e.getMessage());
        } catch (DBException e) {
            logger.error("Got an DB exception... ", e);
            throw new UploadServletException(e.getMessage());
        }
        DBInterface.close(dbi, conn);
        out.println("Success");
    } catch (UploadServletException e) {
        out.println("Upload failed: " + e.getMessage());
        DBInterface.close(dbi, conn, false);
    } finally {
        try {
            uploadedFile.delete();
        } catch (Exception e) {
        }
    }
}

From source file:Servlet.Filtro.java

private HttpServletRequest parse(HttpServletRequest req) {
    List<FileItem> multiparts = null;
    try {/*from   w  w w  .  j a v  a  2  s.  c  o  m*/
        multiparts = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(req);
    } catch (FileUploadException ex) {
        System.err.println("Erro ao recuperar o arquivo. Detalhes: " + ex.getMessage());
    }

    String UPLOAD_DIRECTORY = "C:/Google Drive/IFSP/5 Semestre/TCC/"
            + "Arquivos e Documentos Produzidos pela Equipe/Desenvolvimento/"
            + "NetBeans/Gabriel/HorasComplementares/HorasComplementares/web/comprovantes";

    System.out.println(multiparts);
    for (FileItem item : multiparts) {
        if (!item.isFormField()) {
            String name = new File(item.getName()).getName();
            String url = UPLOAD_DIRECTORY + File.separator + name;
            System.out.println(name);
            System.out.println(url);
            String fieldname = item.getFieldName();
            req.setAttribute(fieldname, item);
            req.setAttribute("url", url);
        } else if (item.isFormField()) {
            // Process regular form field (input type="text|radio|checkbox|etc", select, etc).
            String fieldname = item.getFieldName();
            String fieldvalue = item.getString();
            req.setAttribute(fieldname, fieldvalue);
        }
    }
    return req;
}

From source file:servlets.uploadVideoBrief.java

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException, JSONException {

    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();

    try {//from ww w .  j  a  v a  2 s  .c o m
        out.println("Reached @ uploadVideoBrief");
        /*
         String base64video = request.getParameter("base64video");
         JSONObject videoObject = new JSONObject(base64video);
         String base64code = videoObject.getString("base64value");
                
         byte[] data = Base64.decodeBase64(base64code);
         try (OutputStream stream = new FileOutputStream(System.getenv("OPENSHIFT_DATA_DIR") + "/NPJS_files/uploadedvid.mp4")) {
         stream.write(data);
         } catch (Exception e) {
         e.printStackTrace();
         }
                
         out.println("base64code: " + base64code);
         */

        FileItem stringItem = null;
        FileItem fileItem = null;

        List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
        for (FileItem item : items) {
            if (item.isFormField()) {
                stringItem = item;
                break;
            }
        }
        for (FileItem item : items) {
            if (!item.isFormField()) {
                fileItem = item;
                break;
            }
        }

        if (stringItem != null && fileItem != null) {
            String fileName = stringItem.getString();
            String filePath = System.getenv("OPENSHIFT_DATA_DIR") + "NPJS_files" + File.separator + fileName;
            out.println("filePath: " + filePath);
            File storeFile = new File(filePath);
            fileItem.write(storeFile);
        } else {
            out.println("stringItem or fileItem null.");
        }

    } catch (FileUploadException ex) {
        out.println("Error: FileUploadException");
        out.println(ex.getMessage());
        Logger.getLogger(uploadVideoBrief.class.getName()).log(Level.SEVERE, null, ex);
    } catch (Exception ex) {
        out.println("Error: Exception");
        out.println(ex.getMessage());
        Logger.getLogger(uploadVideoBrief.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:sos.settings.SOSSettingsDialog.java

private void checkRequest() throws Exception {
    this.debug(3, "checkRequest");

    this.settings.sources.put(this.settings.source, this.dialogApplicationsTitle);

    this.settings.application = "";
    this.settings.section = "";
    this.settings.entry = "";

    this.inputQuery = "";
    this.inputExport = "";
    this.inputImport = "";
    this.importOriginalFileName = "";

    // Daten aus fileUpload
    LinkedHashMap requestMultipart = new LinkedHashMap();

    if (this.request != null) {
        /////////////////////////////////////////////////////////
        String contentType = this.request.getHeader("Content-type");
        if (contentType != null && contentType.startsWith("multipart/")) { // ob Import
            try {
                DiskFileUpload upload = new DiskFileUpload();

                upload.setSizeMax(this.importMaxSize);
                upload.setSizeThreshold(0); // nicht im Memory sondern als
                // Datei speichern

                List items = upload.parseRequest(this.request);
                Iterator iter = items.iterator();

                while (iter.hasNext()) {
                    //FileItem item = (FileItem) iter.next();
                    DefaultFileItem item = (DefaultFileItem) iter.next();
                    if (item.isFormField()) {
                        requestMultipart.put(item.getFieldName(), item.getString());
                        this.request.setAttribute(item.getFieldName(), item.getString());
                    } else { // aus upload
                        if (item.getName() != null && !item.getName().equals("")) {
                            //requestMultipart.put(item.getFieldName(),item.getStoreLocation());
                            requestMultipart.put(item.getFieldName(),
                                    item.getStoreLocation().getAbsolutePath());
                            this.request.setAttribute(item.getFieldName(),
                                    item.getStoreLocation().getAbsolutePath());
                            this.importOriginalFileName = item.getName();
                        } else {
                            requestMultipart.put(item.getFieldName(), "");
                            this.request.setAttribute(item.getFieldName(), "");
                        }/*w  w w  . jav  a2  s.  c o m*/

                    }

                }
            } catch (FileUploadException e) {
                this.setError(e.getMessage(), SOSClassUtil.getMethodName());
            }
        } // MULTIPART Form

        /////////////////////////////////////////////////////////              
        if (this.getRequestValue("application") != null) {
            this.settings.application = this.getRequestValue("application");
        }
        if (this.getRequestValue("section") != null) {
            this.settings.section = this.getRequestValue("section");
        }
        if (this.getRequestValue("entry") != null) {
            this.settings.entry = this.getRequestValue("entry");
        }
        if (this.getRequestValue("application_type") != null) {
            try {
                this.applicationType = Integer.parseInt(this.getRequestValue("application_type"));
            } catch (Exception e) {
                this.applicationType = 0;
            }
        }
        if (this.getRequestValue("section_type") != null) {
            try {
                this.sectionType = Integer.parseInt(this.getRequestValue("section_type"));
            } catch (Exception e) {
                this.sectionType = 0;
            }
        }

        if (this.getRequestValue("action") != null) {
            this.action = this.getRequestValue("action");

        }
        if (this.getRequestValue("range") != null) {
            this.range = this.getRequestValue("range");
        }
        if (this.getRequestValue("item") != null) {
            this.item = this.getRequestValue("item");
        }
        if ((this.getRequestValue("btn_store.x") != null) && (this.getRequestValue("btn_store.y") != null)) {
            this.action = "store";
        } else if ((this.getRequestValue("btn_insert.x") != null)
                && (this.getRequestValue("btn_insert.y") != null)) {
            this.action = "insert";
        } else if ((this.getRequestValue("btn_delete.x") != null)
                && (this.getRequestValue("btn_delete.y") != null)) {
            this.action = "delete";
        } else if ((this.getRequestValue("btn_schema.x") != null)
                && (this.getRequestValue("btn_schema.y") != null)) {
            this.action = "schema";
        } else if ((this.getRequestValue("btn_duplicate.x") != null)
                && (this.getRequestValue("btn_duplicate.y") != null)) {
            this.action = "duplicate";
            this.range = "entries";
        } else if ((this.getRequestValue("btn_cancel.x") != null)
                && (this.getRequestValue("btn_cancel.y") != null)) {
            this.action = "show";
            if (this.range.equals("application")) {
                this.range = "applications";
            } else if (this.range.equals("section")) {
                this.range = "sections";
            } else {
                this.range = this.range.equals("list") ? "sections" : "entries";
            }
        } else if ((this.getRequestValue("btn_query.x") != null)
                && (this.getRequestValue("btn_query.y") != null)) {
            this.action = "query";
            this.range = "entries";

            if (this.getRequestValue("query_select_range") != null
                    && this.getRequestValue("query_select_range").equals("2")) {
                this.item = "replace";
            }

        } else if ((this.getRequestValue("btn_export.x") != null)
                && (this.getRequestValue("btn_export.y") != null)) {
            this.action = "export";
            this.range = "entries";
        } else if ((this.getRequestValue("btn_import.x") != null)
                && (this.getRequestValue("btn_import.y") != null)) {
            this.action = "import";
            this.range = "entries";
        } else if ((this.getRequestValue("btn_clipboard_copy.x") != null)
                && (this.getRequestValue("btn_clipboard_copy.y") != null)) {
            if (this.getRequestValue("last_action") != null) {
                this.action = this.getRequestValue("last_action");
            } else {
                this.action = "show";
            }
            this.clipboardAction = "copy";
        } else if ((this.getRequestValue("btn_clipboard_paste.x") != null)
                && (this.getRequestValue("btn_clipboard_paste.y") != null)) {
            if (this.getRequestValue("last_action") != null) {
                this.action = this.getRequestValue("last_action");
            } else {
                this.action = "show";
            }

            this.clipboardAction = "paste";
        } else if ((this.getRequestValue("btn_import_file.x") != null)
                && (this.getRequestValue("btn_import_file.y") != null)) {

            this.action = ((this.getRequestValue("last_action") != null)
                    && this.getRequestValue("last_action").equals("new")) ? "insert" : "store";
            this.range = "entry";
            this.item = "upload";
        }

        if (this.getRequestValue("input_query") != null) {
            this.inputQuery = this.getRequestValue("input_query");
        }

        if (this.getRequestValue("input_query_replace") != null) {
            this.replaceQuery = this.getRequestValue("input_query_replace");
        }

        if (this.getRequestValue("input_export") != null) {
            this.inputExport = this.getRequestValue("input_export");
        }

        if (this.getRequestValue("export_documentation") != null) {
            this.exportDocumentation = 1;
        }

        if (this.getRequestValue("input_import") != null) {
            this.inputImport = this.getRequestValue("input_import");
        }

    }
    if (this.applicationName.equals("")) {
        this.applicationName = this.settings.application;
    }

    if (this.enableShowDevelopmentData) {
        this.showDevelopmentData(requestMultipart);
    }

}