Hello, I don't know how to call this Java code fro...
# getting-started
m
Hello, I don't know how to call this Java code from Kotlin:
Copy code
public static Document parse(File file, @Nullable String charsetName) throws IOException {
        return DataUtil.load(file, charsetName, file.getAbsolutePath());
    }
when I call this code from Kotlin,
Copy code
val document = Jsoup.parse(inputHTML, null )
I get
Copy code
Kotlin: Null can not be a value of a non-null type String
How can I call this with Java type null, since parameter is @Nullable and therefore Null should be accepted.
e
what is the type of
inputHTML
? Jsoup has multiple overloads and there's a non-nullable
Jsoup.parse(String, String)
method
n
What is the type of your
inputHTML
? JSoup also has a `public static Document parse​(String html, Parser parser)`method
m
It is java.io.File