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 { //noinspection ResultOfMethodCallIgnored File.createTempFile("MIME", null, tempDir != null ? new File(tempDir) : null).delete(); } catch (final IOException ioe) { LOGGER.log(Level.WARNING, LocalizationMessages.TEMP_FILE_CANNOT_BE_CREATED(properties.getBufferThreshold()), ioe); } } return mimeConfig; }
/** * @see MIMEMessage(InputStream, String, MIMEConfig) */ public MIMEMessage(InputStream in, String boundary) { this(in, boundary, new MIMEConfig()); }
/** * @see #MIMEMessage(InputStream, String, MIMEConfig) * * @param in MIME message stream * @param boundary the separator for parts(pass it without --) */ public MIMEMessage(InputStream in, String boundary) { this(in, boundary, new MIMEConfig()); }
/** * @see #MIMEMessage(InputStream, String, MIMEConfig) * * @param in MIME message stream * @param boundary the separator for parts(pass it without --) */ public MIMEMessage(InputStream in, String boundary) { this(in, boundary, new MIMEConfig()); }
/** * @see #MIMEMessage(InputStream, String, MIMEConfig) * * @param in MIME message stream * @param boundary the separator for parts(pass it without --) */ public MIMEMessage(InputStream in, String boundary) { this(in, boundary, new MIMEConfig()); }
protected void readSOAPPart() throws MessagingException { 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 { // Strip <...> from root part's Content-I if (st != null && st.length() > 2 && st.charAt(0) == '<' && st.charAt(st.length()-1) == '>') { st = st.substring(1, st.length()-1); } startParam = st; soapPart = mm.getPart(startParam); } } catch (IOException ex) { throw new MessagingException("No inputstream from datasource", ex); } }
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 { //noinspection ResultOfMethodCallIgnored File.createTempFile("MIME", null, tempDir != null ? new File(tempDir) : null).delete(); } catch (final IOException ioe) { LOGGER.log(Level.WARNING, LocalizationMessages.TEMP_FILE_CANNOT_BE_CREATED(properties.getBufferThreshold()), ioe); } } return mimeConfig; }
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 { //noinspection ResultOfMethodCallIgnored File.createTempFile("MIME", null, tempDir != null ? new File(tempDir) : null).delete(); } catch (final IOException ioe) { LOGGER.log(Level.WARNING, LocalizationMessages.TEMP_FILE_CANNOT_BE_CREATED(properties.getBufferThreshold()), ioe); } } return mimeConfig; }
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 { //noinspection ResultOfMethodCallIgnored File.createTempFile("MIME", null, tempDir != null ? new File(tempDir) : null).delete(); } catch (final IOException ioe) { LOGGER.log(Level.WARNING, LocalizationMessages.TEMP_FILE_CANNOT_BE_CREATED(properties.getBufferThreshold()), ioe); } } return mimeConfig; }
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 { //noinspection ResultOfMethodCallIgnored File.createTempFile("MIME", null, tempDir != null ? new File(tempDir) : null).delete(); } catch (final IOException ioe) { LOGGER.log(Level.WARNING, LocalizationMessages.TEMP_FILE_CANNOT_BE_CREATED(properties.getBufferThreshold()), ioe); } } return mimeConfig; }
/** * Returns the configuration object. Once this is called, you cannot * change the configuration. * * @return */ @ManagedAttribute public MIMEConfig getConfig() { if (config == null) { config = new MIMEConfig(); config.setDir(dir); config.setParseEagerly(parseEagerly); config.setMemoryThreshold(memoryThreshold); config.validate(); } return config; }
/** * Returns the configuration object. Once this is called, you cannot * change the configuration. * * @return */ @ManagedAttribute public MIMEConfig getConfig() { if (config == null) { config = new MIMEConfig(); config.setDir(dir); config.setParseEagerly(parseEagerly); config.setMemoryThreshold(memoryThreshold); config.validate(); } return config; }
/** * Returns the configuration object. Once this is called, you cannot * change the configuration. * * @return */ @ManagedAttribute public MIMEConfig getConfig() { if (config == null) { config = new MIMEConfig(); config.setDir(dir); config.setParseEagerly(parseEagerly); config.setMemoryThreshold(memoryThreshold); config.validate(); } return config; }
mimeConfig = new MIMEConfig();
throw new IOException("ContentType does not define boundary"); final MIMEMessage mimeMessage = new MIMEMessage(is, boundary, new MIMEConfig());