Package org.apache.catalina.deploy

Examples of org.apache.catalina.deploy.Multipart


                wrapper.setAsyncSupported(value.isAsyncSupported());
                wrapper.setEnabled(value.isEnabled());
                // Multipart configuration
                if (value.getMultipartConfig() != null) {
                    MultipartConfigMetaData multipartConfigMetaData = value.getMultipartConfig();
                    Multipart multipartConfig = new Multipart();
                    multipartConfig.setLocation(multipartConfigMetaData.getLocation());
                    multipartConfig.setMaxRequestSize(multipartConfigMetaData.getMaxRequestSize());
                    multipartConfig.setMaxFileSize(multipartConfigMetaData.getMaxFileSize());
                    multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                    wrapper.setMultipartConfig(multipartConfig);
                }
                context.addChild(wrapper);
            }
        }
View Full Code Here


                            wrapper.setRunAs(annotation.getRunAs().getRoleName());
                        }
                        // Merge @MultipartConfig
                        if (annotation.getMultipartConfig() != null && wrapper.getMultipartConfig() == null) {
                            MultipartConfigMetaData multipartConfigMetaData = annotation.getMultipartConfig();
                            Multipart multipartConfig = new Multipart();
                            multipartConfig.setLocation(multipartConfigMetaData.getLocation());
                            multipartConfig.setMaxRequestSize(multipartConfigMetaData.getMaxRequestSize());
                            multipartConfig.setMaxFileSize(multipartConfigMetaData.getMaxFileSize());
                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
View Full Code Here

                wrapper.setAsyncSupported(value.isAsyncSupported());
                wrapper.setEnabled(value.isEnabled());
                // Multipart configuration
                if (value.getMultipartConfig() != null) {
                    MultipartConfigMetaData multipartConfigMetaData = value.getMultipartConfig();
                    Multipart multipartConfig = new Multipart();
                    multipartConfig.setLocation(multipartConfigMetaData.getLocation());
                    multipartConfig.setMaxRequestSize(multipartConfigMetaData.getMaxRequestSize());
                    multipartConfig.setMaxFileSize(multipartConfigMetaData.getMaxFileSize());
                    multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                    wrapper.setMultipartConfig(multipartConfig);
                }
                context.addChild(wrapper);
            }
        }
View Full Code Here

                            wrapper.setRunAs(annotation.getRunAs().getRoleName());
                        }
                        // Merge @MultipartConfig
                        if (annotation.getMultipartConfig() != null && wrapper.getMultipartConfig() == null) {
                            MultipartConfigMetaData multipartConfigMetaData = annotation.getMultipartConfig();
                            Multipart multipartConfig = new Multipart();
                            multipartConfig.setLocation(multipartConfigMetaData.getLocation());
                            multipartConfig.setMaxRequestSize(multipartConfigMetaData.getMaxRequestSize());
                            multipartConfig.setMaxFileSize(multipartConfigMetaData.getMaxFileSize());
                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
View Full Code Here

                wrapper.setAsyncSupported(value.isAsyncSupported());
                wrapper.setEnabled(value.isEnabled());
                // Multipart configuration
                if (value.getMultipartConfig() != null) {
                    MultipartConfigMetaData multipartConfigMetaData = value.getMultipartConfig();
                    Multipart multipartConfig = new Multipart();
                    multipartConfig.setLocation(multipartConfigMetaData.getLocation());
                    multipartConfig.setMaxRequestSize(multipartConfigMetaData.getMaxRequestSize());
                    multipartConfig.setMaxFileSize(multipartConfigMetaData.getMaxFileSize());
                    multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                    wrapper.setMultipartConfig(multipartConfig);
                }
                context.addChild(wrapper);
            }
        }
View Full Code Here

                            wrapper.setRunAs(annotation.getRunAs().getRoleName());
                        }
                        // Merge @MultipartConfig
                        if (annotation.getMultipartConfig() != null && wrapper.getMultipartConfig() == null) {
                            MultipartConfigMetaData multipartConfigMetaData = annotation.getMultipartConfig();
                            Multipart multipartConfig = new Multipart();
                            multipartConfig.setLocation(multipartConfigMetaData.getLocation());
                            multipartConfig.setMaxRequestSize(multipartConfigMetaData.getMaxRequestSize());
                            multipartConfig.setMaxFileSize(multipartConfigMetaData.getMaxFileSize());
                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
View Full Code Here

                wrapper.setAsyncSupported(value.isAsyncSupported());
                wrapper.setEnabled(value.isEnabled());
                // Multipart configuration
                if (value.getMultipartConfig() != null) {
                    MultipartConfigMetaData multipartConfigMetaData = value.getMultipartConfig();
                    Multipart multipartConfig = new Multipart();
                    multipartConfig.setLocation(multipartConfigMetaData.getLocation());
                    multipartConfig.setMaxRequestSize(multipartConfigMetaData.getMaxRequestSize());
                    multipartConfig.setMaxFileSize(multipartConfigMetaData.getMaxFileSize());
                    multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                    wrapper.setMultipartConfig(multipartConfig);
                }
                context.addChild(wrapper);
            }
        }
View Full Code Here

                            wrapper.setRunAs(annotation.getRunAs().getRoleName());
                        }
                        // Merge @MultipartConfig
                        if (annotation.getMultipartConfig() != null && wrapper.getMultipartConfig() == null) {
                            MultipartConfigMetaData multipartConfigMetaData = annotation.getMultipartConfig();
                            Multipart multipartConfig = new Multipart();
                            multipartConfig.setLocation(multipartConfigMetaData.getLocation());
                            multipartConfig.setMaxRequestSize(multipartConfigMetaData.getMaxRequestSize());
                            multipartConfig.setMaxFileSize(multipartConfigMetaData.getMaxFileSize());
                            multipartConfig.setFileSizeThreshold(multipartConfigMetaData.getFileSizeThreshold());
                            wrapper.setMultipartConfig(multipartConfig);
                        }
                        // Merge @ServletSecurity
                        if (annotation.getServletSecurity() != null && wrapper.getServletSecurity() == null) {
                            ServletSecurityMetaData servletSecurityAnnotation = annotation.getServletSecurity();
View Full Code Here

                    ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath()));
        }
        if (multipartConfig == null) {
            throw new IllegalArgumentException(sm.getString("servletRegistration.iae"));
        }
        Multipart multipart = new Multipart();
        multipart.setLocation(multipartConfig.getLocation());
        multipart.setMaxFileSize(multipartConfig.getMaxFileSize());
        multipart.setMaxRequestSize(multipartConfig.getMaxRequestSize());
        multipart.setFileSizeThreshold(multipartConfig.getFileSizeThreshold());
        wrapper.setMultipartConfig(multipart);
    }
View Full Code Here

        throws IOException, ServletException {
       
        if (context == null)
            return;

        Multipart config = wrapper.getMultipartConfig();
        if (config == null) {
            return;
        }
       
        if (usingInputStream || usingReader)
            return;

        if (!getMethod().equalsIgnoreCase("POST"))
            return;

        String contentType = getContentType();
        if (contentType == null)
            contentType = "";
        int semicolon = contentType.indexOf(';');
        if (semicolon >= 0) {
            contentType = contentType.substring(0, semicolon).trim();
        } else {
            contentType = contentType.trim();
        }
        if (!("multipart/form-data".equals(contentType)))
            throw new ServletException(sm.getString("coyoteRequest.notMultipart"));

        DiskFileItemFactory factory = new DiskFileItemFactory();
        if (config.getLocation() != null) {
            factory.setRepository(new File(config.getLocation()));
        }
        if (config.getFileSizeThreshold() > 0) {
            factory.setSizeThreshold(config.getFileSizeThreshold());
        }
       
        ServletFileUpload upload = new ServletFileUpload();
        upload.setFileItemFactory(factory);
        upload.setFileSizeMax(config.getMaxFileSize());
        upload.setSizeMax(config.getMaxRequestSize());

        parts = new HashMap<String, Part>();
        try {
            for (FileItem fileItem : upload.parseRequest(getRequest())) {
                if (fileItem.getName() == null) {
View Full Code Here

TOP

Related Classes of org.apache.catalina.deploy.Multipart

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.