Skip to content

Commit a0c141a

Browse files
committed
fix: migrate to builder
1 parent 8e80200 commit a0c141a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/osahner/service/CsvImportService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package osahner.service
22

33
import com.opencsv.bean.CsvToBeanBuilder
4-
import org.apache.commons.io.input.BOMInputStream
4+
import org.apache.commons.io.input.BOMInputStream.builder
55
import org.springframework.stereotype.Component
66
import org.springframework.web.multipart.MultipartFile
77

88
@Component
99
class CsvImportService {
1010
final inline fun <reified T : CsvImportDto<S>, S> import(file: MultipartFile): Collection<S> =
11-
BOMInputStream(file.inputStream).bufferedReader().use { stream ->
11+
builder().setInputStream(file.inputStream).get().bufferedReader().use { stream ->
1212
CsvToBeanBuilder<T>(stream)
1313
.withType(T::class.java)
1414
.withIgnoreLeadingWhiteSpace(true)

0 commit comments

Comments
 (0)