2

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?
}
VLAZ
  • 26,331
  • 9
  • 49
  • 67
Milgo
  • 2,617
  • 4
  • 22
  • 37

0 Answers0