package com.github.davinkevin.podcastserver.extension.java.net

import org.apache.commons.io.FilenameUtils
import java.net.URI

/**
 * Created by kevin on 12/07/2020
 */
fun URI.extension(): String = FilenameUtils
        .getExtension(this.toASCIIString())
        .let { if (it.isEmpty()) "jpg" else it.substringBeforeLast("?") }

package com.github.davinkevin.podcastserver.extension.java.net

import java.net.URI

/**
 * Created by kevin on 12/07/2020
 */
fun URI.extension(): String {
    val path = this.path

    if(!path.contains(".")) {
        return "jpg"
    }

    return path.substringAfterLast(".")
}

Remove usage of apache commons for file extension extraction
refactor(backend): Remove usage of apache commons for file extension extraction

davinkevin/Podcast-Server,davinkevin/Podcast-Server,davinkevin/Podcast-Server,davinkevin/Podcast-Server,davinkevin/Podcast-Server