I need to parse a CSV input from an URL
. That's not so complicated but the URL
needs a basic authentication. Is there a way to use basic authentication for the CSV input directly with Jackson or do I need to read the input in as a String and parse it afterwards with Jackson?
private static List<Result> read(URL url) throws IOException {
CsvMapper mapper = new CsvMapper();
CsvSchema schema = mapper.schemaFor(Result.class).withColumnReordering(true).withColumnSeparator(',').withHeader();
ObjectReader reader = mapper.readerFor(Result.class).with(schema);
return reader.<Result>readValues(url).readAll(); // how to use basic authentication here?
}