mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #2050 from jbarotin/master
make SeaweedInputStream throw FileNotFoundException
This commit is contained in:
commit
48601bce6c
|
@ -6,6 +6,7 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.EOFException;
|
import java.io.EOFException;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
@ -34,6 +35,10 @@ public class SeaweedInputStream extends InputStream {
|
||||||
this.entry = filerClient.lookupEntry(
|
this.entry = filerClient.lookupEntry(
|
||||||
SeaweedOutputStream.getParentDirectory(fullpath),
|
SeaweedOutputStream.getParentDirectory(fullpath),
|
||||||
SeaweedOutputStream.getFileName(fullpath));
|
SeaweedOutputStream.getFileName(fullpath));
|
||||||
|
if(entry == null){
|
||||||
|
throw new FileNotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
this.contentLength = SeaweedRead.fileSize(entry);
|
this.contentLength = SeaweedRead.fileSize(entry);
|
||||||
|
|
||||||
this.visibleIntervalList = SeaweedRead.nonOverlappingVisibleIntervals(filerClient, entry.getChunksList());
|
this.visibleIntervalList = SeaweedRead.nonOverlappingVisibleIntervals(filerClient, entry.getChunksList());
|
||||||
|
|
Loading…
Reference in a new issue