Fix a bug, which caused the full-text files to never close.
This commit is contained in:
parent
3473d91ce4
commit
b3196376eb
|
@ -40,10 +40,11 @@ public class FileDecompressor {
|
|||
while ( ((entry = (TarArchiveEntry) tarInput.getNextEntry()) != null) )
|
||||
{
|
||||
// Copy an individual entry.
|
||||
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(Files.newOutputStream(targetDir.resolve(entry.getName())), FileUtils.tenMb);
|
||||
while ( (readByte = tarInput.read()) != -1 )
|
||||
bufferedOutputStream.write(readByte);
|
||||
// No need to close the tarEntry.
|
||||
try ( BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(Files.newOutputStream(targetDir.resolve(entry.getName())), FileUtils.tenMb) ) {
|
||||
while ( (readByte = tarInput.read()) != -1 )
|
||||
bufferedOutputStream.write(readByte);
|
||||
} // The exception will be given to the caller method.
|
||||
// No need to close the tarEntry (no "close()" method is provided).
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue