Skip to content

Commit

Permalink
migrate from JavaMail to Jakarta (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicopico-dev authored Feb 17, 2024
1 parent c43bd60 commit 38b0c03
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ dependencies {

implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("javax.mail:javax.mail-api:1.6.2")
implementation("com.sun.mail:javax.mail:1.6.2")
implementation("com.sun.mail:jakarta.mail:2.0.1")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.5.0")
implementation("org.jsoup:jsoup:1.15.3")
implementation("com.rometools:rome:1.16.0")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package fr.nicopico.n2rss.mail.client

import fr.nicopico.n2rss.models.Email
import jakarta.mail.Flags
import jakarta.mail.Folder
import jakarta.mail.Message
import jakarta.mail.Session
import jakarta.mail.search.FlagTerm
import java.util.*
import javax.mail.Flags
import javax.mail.Folder
import javax.mail.Message
import javax.mail.Session
import javax.mail.search.FlagTerm

class JavaxEmailClient(
private val protocol: String,
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/fr/nicopico/n2rss/mail/client/MessageExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package fr.nicopico.n2rss.mail.client
import fr.nicopico.n2rss.models.Email
import fr.nicopico.n2rss.models.Sender
import fr.nicopico.n2rss.utils.toKotlinLocaleDate
import javax.mail.Message
import javax.mail.internet.MimeMultipart
import jakarta.mail.Message
import jakarta.mail.internet.MimeMultipart

fun Message.toEmail() = Email(
Sender(email = from[0].toString()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package fr.nicopico.n2rss.mail.client

import fr.nicopico.n2rss.models.Email
import jakarta.mail.Session
import jakarta.mail.internet.MimeMessage
import java.io.FileInputStream
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
import java.util.stream.Collectors
import javax.mail.Session
import javax.mail.internet.MimeMessage

class ResourceFileEmailClient(
private val resFolder: String
Expand Down

0 comments on commit 38b0c03

Please sign in to comment.