Jersey 3.0.1 - Cannot get MediaType from FormDataBodyPart

467 Views Asked by At

i have updated my project dependencies in gradle from compile("org.glassfish.jersey.media:jersey-media-multipart:2.3.2") to compile("org.glassfish.jersey.media:jersey-media-multipart:3.0.1")

And i get the following error, tried to inspect the code to see if would point me into the direction of getting the MediaType from FormDataBodyPart but was not able to figure it out, where should i get the Mediatype in Jersey 3?

private boolean isFileChecksOk(FormDataContentDisposition fileDisposition, FormDataBodyPart body, byte[] bytes) {

        boolean mediaTypeOk = body.getMediaType().getSubtype().equalsIgnoreCase(excelMediaType);
        ...
        ...    

}

error: cannot access MediaType
        boolean mediaTypeOk = body.getMediaType().getSubtype().equalsIgnoreCase(excelMediaType);
                                               ^
  class file for jakarta.ws.rs.core.MediaType not found

build.gradle dependencies:

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:2.4.3")
    }
}
dependencies {

    implementation 'junit:junit:4.13.2'

    compile("org.springframework.boot:spring-boot-starter-security")
    compile("org.springframework.boot:spring-boot-starter-jersey")
    compile("org.springframework.boot:spring-boot-starter-web")
    compile("org.springframework.boot:spring-boot-starter-thymeleaf")
    compile("org.springframework.boot:spring-boot-starter-data-jpa")
    compile("org.springframework.boot:spring-boot-starter-jetty")
    compile("org.springframework.boot:spring-boot-starter-mail")
    compile("org.springframework.boot:spring-boot-starter-actuator")

    compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")
    compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
    compile("com.fasterxml.woodstox:woodstox-core:6.2.4")

    compile("org.glassfish.jersey.media:jersey-media-multipart:3.0.1")
    compile("net.java.dev.msv:msv-core:2013.6.1")
    compile("com.impossibl.pgjdbc-ng:pgjdbc-ng:0.8.6")
    compile('org.apache.commons:commons-lang3:3.12.0')
    compile('commons-io:commons-io:2.8.0')
    compile('org.apache.commons:commons-compress:1.20')
    compile('org.apache.poi:poi-ooxml:4.1.2')
    compile('org.apache.xmlbeans:xmlbeans:3.1.0')
    compile('com.monitorjbl:xlsx-streamer:2.1.0')
    compile('com.zaxxer:HikariCP')
    compile("org.quartz-scheduler:quartz:2.3.2"){
        exclude group: 'com.zaxxer', module: 'HikariCP-java7'
    }
    compile('no.applikativ:twistgrid-builder:2.0.0')
    compile('org.apache.tika:tika-parsers:1.25')
    testCompile("org.springframework.boot:spring-boot-starter-test")

    slowtestCompile("org.latencyutils:LatencyUtils:2.0.3")    slowtestCompile("org.junit.platform:junit-platform-console-standalone:1.7.0")


}

TIA

0

There are 0 best solutions below