Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.java>25</version.java>
<version.errorprone>2.46.0</version.errorprone>
<version.errorprone>2.47.0</version.errorprone>
<version.jsoup>1.22.1</version.jsoup>
<velocity.version>2.4.1</velocity.version>
<subetha.version>3.1.7</subetha.version>
Expand Down Expand Up @@ -162,6 +162,7 @@
<version>${version.maven.compiler}</version>
<configuration>
<release>${version.java}</release>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<failOnWarning>true</failOnWarning>
<maxmem>2048m</maxmem>
Expand All @@ -170,15 +171,16 @@
<arg>-parameters</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -Xep:UnusedMethod:OFF -Xep:JavaTimeDefaultTimeZone:OFF -Xep:ObjectEqualsForPrimitives:OFF -Xep:StringCaseLocaleUsage:OFF</arg>
<arg>-Xplugin:ErrorProne -Xep:UnusedMethod:OFF -Xep:JavaTimeDefaultTimeZone:OFF -Xep:ObjectEqualsForPrimitives:OFF -Xep:StringCaseLocaleUsage:OFF -Xep:MissingSummary:OFF</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
</compilerArgs>
<annotationProcessorPaths>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
package co.cfly.email.impl.attachments;

import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;

import co.cfly.email.api.AttachmentException;
import co.cfly.email.api.ContentDisposition;
Expand All @@ -27,7 +28,7 @@ public URLAttachment(String url, String fileName, ContentDisposition contentDisp
super();
URLDataSource uds;
try {
uds = new URLDataSource(new URL(url));
uds = new URLDataSource(new URI(url).toURL());
super.setFileName(fileName);
super.setMimeType(uds.getContentType());
super.setContentDisposition(contentDisposition);
Expand All @@ -36,6 +37,9 @@ public URLAttachment(String url, String fileName, ContentDisposition contentDisp
catch (IOException e) {
throw new AttachmentException("Wasn't able to create email attachment from URL: " + url, e);
}
catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}

public URLAttachment(String url, String fileName, ContentDisposition contentDisposition, String contentClass) {
Expand Down