Package org.apache.commons.fileupload.disk

Examples of org.apache.commons.fileupload.disk.DiskFileItemFactory


        if (!PortletFileUpload.isMultipartContent(actionRequest)) {
            throw new PortletException("Expected file upload");
        }

        File rootDir = new File(System.getProperty("java.io.tmpdir"));
        PortletFileUpload uploader = new PortletFileUpload(new DiskFileItemFactory(10240, rootDir));
        File moduleFile = null;
        File planFile = null;
        String startApp = null;
        String redeploy = null;
        try {
View Full Code Here


            String fileType = null;
            String artifact = null;
            String version = null;
            String group = null;

            PortletFileUpload uploader = new PortletFileUpload(new DiskFileItemFactory());
            try {
                List items = uploader.parseRequest(actionRequest);
                for (Iterator i = items.iterator(); i.hasNext();) {
                    FileItem item = (FileItem) i.next();
                    if (!item.isFormField()) {
View Full Code Here

        response.setRenderParameter("importSource", type);
        if (!PortletFileUpload.isMultipartContent(request)) {
            throw new PortletException("Expected file upload");
        }

        PortletFileUpload uploader = new PortletFileUpload(new DiskFileItemFactory());
        try {
            List<FileItem> items = uploader.parseRequest(request);
            for (FileItem item : items) {
                if (!item.isFormField()) {
                    File file = File.createTempFile("geronimo-import", "");
View Full Code Here

        // Create a new file upload handler
        ServletFileUpload upload = new ServletFileUpload();
        upload.setSizeMax(ParameterSupport.maxRequestSize);
        upload.setFileSizeMax(ParameterSupport.maxFileSize);
        upload.setFileItemFactory(new DiskFileItemFactory(ParameterSupport.fileSizeThreshold,
            ParameterSupport.location));

        RequestContext rc = new ServletRequestContext(this.getServletRequest()) {
            @Override
            public String getCharacterEncoding() {
View Full Code Here

    private void installBasedOnUploadedJar(HttpServletRequest req, HttpServletResponse resp) throws IOException {

        InstallationResult result = null;

        try {
            DiskFileItemFactory factory = new DiskFileItemFactory();
            // try to hold even largish bundles in memory to potentially improve performance
            factory.setSizeThreshold(UPLOAD_IN_MEMORY_SIZE_THRESHOLD);

            ServletFileUpload upload = new ServletFileUpload();
            upload.setFileItemFactory(factory);

            @SuppressWarnings("unchecked")
View Full Code Here

            resp.sendRedirect(req.getRequestURI());
            return;
        }

        // Create a factory for disk-based file items
        DiskFileItemFactory factory = new DiskFileItemFactory();
        factory.setSizeThreshold(256000);

        // Create a new file upload handler
        ServletFileUpload upload = new ServletFileUpload(factory);
        upload.setSizeMax(-1);
View Full Code Here

        Map params = ( Map ) request.getAttribute( AbstractWebConsolePlugin.ATTR_FILEUPLOAD );
        if ( params == null )
        {
            // parameters not read yet, read now
            // Create a factory for disk-based file items
            DiskFileItemFactory factory = new DiskFileItemFactory();
            factory.setSizeThreshold( 256000 );
            // See https://issues.apache.org/jira/browse/FELIX-4660
            final Object repo = request.getAttribute( AbstractWebConsolePlugin.ATTR_FILEUPLOAD_REPO );
            if ( repo instanceof File )
            {
                factory.setRepository( (File) repo );
            }

            // Create a new file upload handler
            ServletFileUpload upload = new ServletFileUpload( factory );
            upload.setSizeMax( -1 );
View Full Code Here

        String path = request.getParameter("path");
        resp.setContentType("application/json");
        boolean explodeZip = "1".equals(request.getParameter("explodeZip"));

        // Create a factory for disk-based file items
        FileItemFactory factory = new DiskFileItemFactory();

        // Create a new file upload handler
        ServletFileUpload upload = new ServletFileUpload(factory);

        ArrayList<String> fileNames = new ArrayList<String>();
View Full Code Here

        Permissions.ensureAdmin(request);

        if (ServletFileUpload.isMultipartContent(request)) {
            Translations translations = ControllerUtils.getTranslations(request);

            ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory(100, null));
            List<FileItem> items;
            try {
                items = upload.parseRequest(request);

                for (FileItem item : items) {
View Full Code Here

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
        if (ServletFileUpload.isMultipartContent(request)) {
            User user = Common.getUser(request);
            GraphicalView view = GraphicalViewsCommon.getUserEditView(user);

            ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory());

            List<FileItem> items;
            try {
                items = upload.parseRequest(request);
            }
View Full Code Here

TOP

Related Classes of org.apache.commons.fileupload.disk.DiskFileItemFactory

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.