fix compress fail when file size is Integer.MAX_VALUE (#6159)

This commit is contained in:
kaijianding 2018-08-15 06:13:47 +08:00 committed by Jihoon Son
parent c47032d566
commit 8d886e59bf
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ public class CompressionUtils
long totalSize = 0; long totalSize = 0;
for (File file : directory.listFiles()) { for (File file : directory.listFiles()) {
log.info("Adding file[%s] with size[%,d]. Total size so far[%,d]", file, file.length(), totalSize); log.info("Adding file[%s] with size[%,d]. Total size so far[%,d]", file, file.length(), totalSize);
if (file.length() >= Integer.MAX_VALUE) { if (file.length() > Integer.MAX_VALUE) {
zipOut.finish(); zipOut.finish();
throw new IOE("file[%s] too large [%,d]", file, file.length()); throw new IOE("file[%s] too large [%,d]", file, file.length());
} }