Oleg Sukhodolsky
2008-12-06 05:55:46 UTC
Hi,
I have got exception while parsing the following Content-Disposition:
Content-Disposition: attachment;
filename==?Windows-1251?B?8OXq4ujn6PL7IMjPLmRvYw?=
javamail says:
javax.mail.internet.ParseException: Expected parameter value, got "="
at javax.mail.internet.ParameterList.<init>(ParameterList.java:253)
here is a test for this problem:
import javax.mail.internet.ParameterList;
import javax.mail.internet.ParseException;
public class Crm673 {
public static void main(String[] args) throws ParseException {
String params = "; filename==?Windows-1251?B?8OXq4ujn6PL7IMjPLmRvYw?=";
final ParameterList pl = new ParameterList(params);
System.out.println(pl.get("filename"));
}
}
As far as I understand the code, javamail expects either ATOM or
QUOTEDSTRING after "filename=" but found
"=". So, what kind of quoted string it expect here? Is there any way
to help/force javamail to understand
this file name?
BTW I'm using latest snapshot of 1.4.2
Thanks in advance, Oleg.
===========================================================================
To unsubscribe, send email to ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".
I have got exception while parsing the following Content-Disposition:
Content-Disposition: attachment;
filename==?Windows-1251?B?8OXq4ujn6PL7IMjPLmRvYw?=
javamail says:
javax.mail.internet.ParseException: Expected parameter value, got "="
at javax.mail.internet.ParameterList.<init>(ParameterList.java:253)
here is a test for this problem:
import javax.mail.internet.ParameterList;
import javax.mail.internet.ParseException;
public class Crm673 {
public static void main(String[] args) throws ParseException {
String params = "; filename==?Windows-1251?B?8OXq4ujn6PL7IMjPLmRvYw?=";
final ParameterList pl = new ParameterList(params);
System.out.println(pl.get("filename"));
}
}
As far as I understand the code, javamail expects either ATOM or
QUOTEDSTRING after "filename=" but found
"=". So, what kind of quoted string it expect here? Is there any way
to help/force javamail to understand
this file name?
BTW I'm using latest snapshot of 1.4.2
Thanks in advance, Oleg.
===========================================================================
To unsubscribe, send email to ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".