에러 해결 기록이 뒤죽박죽 이긴 한데,,ㅎㅎ
기록이 중요하니까 !
No content length specified for stream data. Stream contents will be buffered in memory and could result in out of memory errors.
s3 업로드시 setContentLength 를 지정하지 않거나 IOUtils.toByteArray(inputStream) 사용시 inputStream 이 소진되어 발생하는 경고
setContentLength 을 지정하지 않아서 해당 블로그를 참고해서 수정했다.
metadata.setContentType(Mimetypes.getInstance().getMimetype(filename));
byte[] bytes = IOUtils.toByteArray(file.getInputStream());
metadata.setContentLength(bytes.length);
ByteArrayInputStream byteArrayIs = new ByteArrayInputStream(bytes);
PutObjectRequest por = new PutObjectRequest(bucket, filename, byteArrayIs, metadata)
.withCannedAcl(CannedAccessControlList.PublicRead);
amazonS3.putObject(por);