mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 22:36:20 +00:00
close stream if file not found (though a stream is not really opened in this case...)
This commit is contained in:
parent
abe33d59a5
commit
20b6e0bdde
@ -25,6 +25,7 @@ import org.elasticsearch.common.blobstore.support.AbstractBlobContainer;
|
||||
import org.elasticsearch.common.blobstore.support.PlainBlobMetaData;
|
||||
import org.elasticsearch.common.collect.ImmutableMap;
|
||||
import org.elasticsearch.common.collect.MapBuilder;
|
||||
import org.elasticsearch.common.io.Closeables;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@ -77,10 +78,11 @@ public abstract class AbstractFsBlobContainer extends AbstractBlobContainer {
|
||||
blobStore.executor().execute(new Runnable() {
|
||||
@Override public void run() {
|
||||
byte[] buffer = new byte[blobStore.bufferSizeInBytes()];
|
||||
FileInputStream is;
|
||||
FileInputStream is = null;
|
||||
try {
|
||||
is = new FileInputStream(new File(path, blobName));
|
||||
} catch (FileNotFoundException e) {
|
||||
Closeables.closeQuietly(is);
|
||||
listener.onFailure(e);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user