|
@@ -10,11 +10,11 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.annotation.PostConstruct;
|
|
import javax.annotation.PostConstruct;
|
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.ByteArrayInputStream;
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
|
-import java.io.FileReader;
|
|
|
|
|
import java.io.InputStreamReader;
|
|
import java.io.InputStreamReader;
|
|
|
import java.io.Reader;
|
|
import java.io.Reader;
|
|
|
import java.nio.charset.Charset;
|
|
import java.nio.charset.Charset;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
+import java.nio.file.Files;
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
@@ -202,7 +202,7 @@ public class OrderDataStore {
|
|
|
List<OrderRecord> buffer = new ArrayList<>();
|
|
List<OrderRecord> buffer = new ArrayList<>();
|
|
|
int added = 0;
|
|
int added = 0;
|
|
|
int garbled = 0;
|
|
int garbled = 0;
|
|
|
- try (Reader reader = new FileReader(file, charset);
|
|
|
|
|
|
|
+ try (Reader reader = Files.newBufferedReader(file.toPath(), charset);
|
|
|
CSVParser csvParser = new CSVParser(reader, format)) {
|
|
CSVParser csvParser = new CSVParser(reader, format)) {
|
|
|
for (CSVRecord record : csvParser) {
|
|
for (CSVRecord record : csvParser) {
|
|
|
OrderRecord order = toOrderRecord(record);
|
|
OrderRecord order = toOrderRecord(record);
|