쉼표로 분리할 경우 데이터 나누기가 잘못되어, 탭을 구분자로 사용하기 위해 아래와 같이 tsv파일 생성 후 s3에 업로드 하였습니다.
public void uploadCsv(UploadContent uploadContent) {
// 임시 경로 생성
String tempDir = System.getProperty("java.io.tmpdir");
log.info(tempDir.toString());
BufferedWriter bw = null;
File tempFile = null;
// 줄 바꿈
String newLine = System.lineSeparator();
// s3 경로 설정
String prefix = "service=".concat("upload").concat("/").concat("log");
try {
tempFile = File.createTempFile(uploadContent.getAdvtsLoginId(),".tsv", new File(tempDir));
bw = new BufferedWriter(new FileWriter(tempFile));
bw.write("schema_nm \t table_nm \t date_list");
bw.write(newLine);
bw.write(uploadContent.getSchemaNm() + "\t");
bw.write(uploadContent.getTableNm() + "\t");
bw.write(uploadContent.getDtListStr());
bw.flush();
this.awsS3Config.putObjectFile(prefix, tempFile, uploadContent);
} catch (Exception e) {
e.printStackTrace();
}
}