Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParseException: expected ';', got "[" #11

Open
strahl opened this issue May 25, 2022 · 1 comment
Open

ParseException: expected ';', got "[" #11

strahl opened this issue May 25, 2022 · 1 comment

Comments

@strahl
Copy link

strahl commented May 25, 2022

First thanks a lot for your tool! I got the following error when calling java -jar GmailAttachmentsExtractor.jar larger:5M ~/Dokumente/EMailAttachments using the precompiled 1.0.3 JAR from github.

517/~611 (84%) | Processing email '[C.A.R.] Thank you!'
    Extracting 3 attachment(s) to directory '2008.05.12 12_59_25 [C.A.R.] Thank you!'
javax.mail.internet.ParseException: In parameter list <; filename=IMG_0907[1]>, expected ';', got "["
        at javax.mail.internet.ParameterList.<init>(ParameterList.java:314)
        at javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:109)
        at javax.mail.internet.MimeBodyPart.getFileName(MimeBodyPart.java:1294)
        at javax.mail.internet.MimeBodyPart.getFileName(MimeBodyPart.java:549)
        at pl.geek.tewu.gmail_attachments_extractor.Utils.getPartFileName(Utils.java:208)
        at pl.geek.tewu.gmail_attachments_extractor.GmailAttachmentsExtractor.extractAttachments(GmailAttachmentsExtractor.java:154)
        at pl.geek.tewu.gmail_attachments_extractor.Main.call(Main.java:45)
        at pl.geek.tewu.gmail_attachments_extractor.Main.call(Main.java:14)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1783)
        at picocli.CommandLine.access$900(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2150)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2144)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2108)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1975)
        at picocli.CommandLine.execute(CommandLine.java:1904)
        at pl.geek.tewu.gmail_attachments_extractor.Main.main(Main.java:29)

❯ java -jar GmailAttachmentsExtractor.jar --version
1.0.3
❯ java --version
openjdk 17.0.3 2022-04-19
OpenJDK Runtime Environment (build 17.0.3+7-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.3+7-Debian-1deb11u1, mixed mode, sharing)
@strahl
Copy link
Author

strahl commented May 25, 2022

I looked into it with a debugger and found the --unsafe option which fixed the parse exception. Here the output from the debug console at the exception Utils.java line 208:

> part
MimeBodyPart@68
> exc
ParseException@69 "javax.mail.internet.ParseException: In parameter list <; filename=IMG_0907[1]>, expected ';', got "[""
> fixNotQuotedPartFileName(part)
(void)
> part.getFileName()
"IMG_0907[1]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant