Package org.jboss.netty.handler.codec.http.multipart

Examples of org.jboss.netty.handler.codec.http.multipart.HttpDataFactory


        // Set up the event pipeline factory.
        bootstrap.setPipelineFactory(new HttpUploadClientPipelineFactory(ssl));

        // setup the factory: here using a mixed memory/disk based on size threshold
        HttpDataFactory factory = new DefaultHttpDataFactory(
                DefaultHttpDataFactory.MINSIZE); // Disk if size exceed MINSIZE
        DiskFileUpload.deleteOnExitTemporaryFile = true; // should delete file on exit (in normal exit)
        DiskFileUpload.baseDirectory = null; // system temp directory
        DiskAttribute.deleteOnExitTemporaryFile = true; // should delete file on exit (in normal exit)
        DiskAttribute.baseDirectory = null; // system temp directory

        // Simple Get form: no factory used (not usable)
        List<Entry<String, String>> headers =
            formget(bootstrap, host, port, get, uriSimple);
        if (headers == null) {
            factory.cleanAllHttpDatas();
            return;
        }
        // Simple Post form: factory used for big attributes
        List<InterfaceHttpData> bodylist =
            formpost(bootstrap, host, port, uriSimple, file, factory, headers);
        if (bodylist == null) {
            factory.cleanAllHttpDatas();
            return;
        }
        // Multipart Post form: factory used
        formpostmultipart(bootstrap, host, port, uriFile, factory, headers, bodylist);

        // Shut down executor threads to exit.
        bootstrap.releaseExternalResources();
        // Really clean all temporary files if they still exist
        factory.cleanAllHttpDatas();
    }
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.http.multipart.HttpDataFactory

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.