All pastes #2078021 Raw Edit

Someone

public text v1 · immutable
#2078021 ·published 2011-08-24 07:56 UTC
rendered paste body
This ContentType String: 

application/octet-stream; charset=iso-8859-1; name=Lpex3_asdf_30.07.2011 05_10_00.txt


Causes this error:

javax.mail.internet.ParseException: Expected ';', got "05_10_00.txt"
	at javax.mail.internet.ParameterList.<init>(ParameterList.java:280)
	at javax.mail.internet.ContentType.<init>(ContentType.java:110)
	at de.kisters.kidsm.auto.location.MailLocation.treatMultiPartMessage(MailLocation.java:308)
	at de.kisters.kidsm.auto.location.MailLocation.loadItem(MailLocation.java:219)
	at de.kisters.kidsm.auto.location.MailLocation.retrieveItemsFiltered(MailLocation.java:852)
	at de.kisters.kidsm.auto.location.LocationBase.retrieveItemsFiltered(LocationBase.java:447)
	at de.kisters.kidsm.auto.location.LocationBase.transferItemsFilteredTo(LocationBase.java:671)
	at de.kisters.kidsm.auto.job.DistributionJob.executeTask(DistributionJob.java:100)
	at de.kisters.kidsm.auto.job.JobBase.run(JobBase.java:114)

When trying to do this:

String cType = attachementPart.getContentType();
                    ContentType contentType = new ContentType(cType);


I'm trying to get the ContentType for this:

if (contentType != null
                        && contentType.getPrimaryType().equals("multipart"))
...


Is there a different way for that?