Package org.jvnet.mimepull

Examples of org.jvnet.mimepull.MIMEConfig


        if (config == null) {
            throw new IllegalArgumentException("The MultiPartConfig instance we expected is not present.  Have you registered the MultiPartConfigProvider class?");
        }
        this.config = config;

        mimeConfig = new MIMEConfig();
        mimeConfig.setMemoryThreshold(config.getBufferThreshold());
    }
View Full Code Here


        mimeConfig = createMimeConfig(properties);
    }

    private MIMEConfig createMimeConfig(final MultiPartProperties properties) {
        final MIMEConfig mimeConfig = new MIMEConfig();

        // Set values defined by user.
        mimeConfig.setMemoryThreshold(properties.getBufferThreshold());

        final String tempDir = properties.getTempDir();
        if (tempDir != null) {
            mimeConfig.setDir(tempDir);
        }

        if (properties.getBufferThreshold() != MultiPartProperties.BUFFER_THRESHOLD_MEMORY_ONLY) {
            // Validate - this checks whether it's possible to create temp files in currently set temp directory.
            try {
View Full Code Here

        try {
            if (soapPart != null) {
                return;
            }
            in = dataSource.getInputStream();
            MIMEConfig config = new MIMEConfig(); //use defaults
            mm = new MIMEMessage(in, boundary, config);
            String st = contType.getParameter("start");
            if(startParam == null) {
                soapPart = mm.getPart(0);
            } else {
View Full Code Here

     * @return
     */
    @ManagedAttribute
    public MIMEConfig getConfig() {
        if (config == null) {
            config = new MIMEConfig();
            config.setDir(dir);
            config.setParseEagerly(parseEagerly);
            config.setMemoryThreshold(memoryThreshold);
            config.validate();
        }
View Full Code Here

        mimeConfig = createMimeConfig(properties);
    }

    private MIMEConfig createMimeConfig(final MultiPartProperties properties) {
        final MIMEConfig mimeConfig = new MIMEConfig();

        // Set values defined by user.
        mimeConfig.setMemoryThreshold(properties.getBufferThreshold());

        final String tempDir = properties.getTempDir();
        if (tempDir != null) {
            mimeConfig.setDir(tempDir);
        }

        if (properties.getBufferThreshold() != MultiPartProperties.BUFFER_THRESHOLD_MEMORY_ONLY) {
            // Validate - this checks whether it's possible to create temp files in currently set temp directory.
            try {
View Full Code Here

        if (config == null) {
            throw new IllegalArgumentException("The MultiPartConfig instance we expected is not present.  Have you registered the MultiPartConfigProvider class?");
        }
        this.config = config;

        mimeConfig = new MIMEConfig();
        mimeConfig.setMemoryThreshold(config.getBufferThreshold());
    }
View Full Code Here

        Properties mtProps = parseHeaderParams(contentType);
        final String boundary = mtProps.getProperty("boundary");
        if (!StringUtils.ok(boundary)) {
            throw new IOException("ContentType does not define boundary");
        }
        final MIMEMessage mimeMessage = new MIMEMessage(is, boundary, new MIMEConfig());
        //Parse
        for (MIMEPart mimePart : mimeMessage.getAttachments()) {
            String cd = getFirst(mimePart.getHeader("Content-Disposition"));
            if (!StringUtils.ok(cd)) {
                cd = "file";
View Full Code Here

        if (config == null) {
            throw new IllegalArgumentException(LocalizationMessages.CONFIG_NOT_PRESENT());
        }

        mimeConfig = new MIMEConfig();
        mimeConfig.setMemoryThreshold(config.getBufferThreshold());
    }
View Full Code Here

     * @return
     */
    @ManagedAttribute
    public MIMEConfig getConfig() {
        if (config == null) {
            config = new MIMEConfig();
            config.setDir(dir);
            config.setParseEagerly(parseEagerly);
            config.setMemoryThreshold(memoryThreshold);
            config.validate();
        }
View Full Code Here

        try {
            if (soapPart != null) {
                return;
            }
            in = dataSource.getInputStream();
            MIMEConfig config = new MIMEConfig(); //use defaults
            mm = new MIMEMessage(in, boundary, config);
            String st = contType.getParameter("start");
            if(startParam == null) {
                soapPart = mm.getPart(0);
            } else {
View Full Code Here

TOP

Related Classes of org.jvnet.mimepull.MIMEConfig

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.