Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-19-2008, 02:34 PM
mwildam's Avatar
Member
 
Join Date: Aug 2007
Posts: 65
mwildam is on a distinguished road
MimeUtility.decode encoding
I tried to extract attachments from a mime message and first I got errors like

"needed at least 2 valid base64 characters ... "

Searching the internet I found people having similar issues and setting
Code:
System.setProperty("mail.mime.base64.ignoreerrors", "true");
solved their problem - but for me didn't.

Instead looking at samples and playing around I found out that
Code:
os = MimeUtility.decode(part.getInputStream(), "binary");
solved my problem where previously I used:
Code:
enc = MimeUtility.getEncoding(part.getDataHandler()); os = MimeUtility.decode(part.getInputStream(), enc);
My question: According to decode method's javadoc I cannot see any logical reason or hint why I have to use "binary" and not the actual encoding of the content. So why the hell do I have to use "binary"? I don't understand that.
__________________
Greetings, Martin Wildam.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-19-2008, 04:04 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,225
Norm is on a distinguished road
Where is the MimeUtility defined? I don't see it in my JDK 1.6
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-19-2008, 04:41 PM
mwildam's Avatar
Member
 
Join Date: Aug 2007
Posts: 65
mwildam is on a distinguished road
It is part of the javamail package.
__________________
Greetings, Martin Wildam.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
encoding special characers in jsp nanimtech JavaServer Pages (JSP) and JSTL 3 05-06-2008 03:22 PM
Some help with encoding... nm123 Networking 0 04-15-2008 02:22 AM
Missing text encoding talgreen Eclipse 0 03-30-2008 10:14 PM
Xml Parse throws SaxParseException. Encoding is UTF-8 insteadof ISO-8859-1 ? j_kathiresan XML 1 03-28-2008 07:08 PM
How to convert the encoding of a file valery New To Java 1 08-06-2007 05:48 AM


All times are GMT +3. The time now is 09:36 AM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org