Browse Source
Merge pull request #2050 from jbarotin/master
make SeaweedInputStream throw FileNotFoundException
pull/2052/head
Chris Lu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
0 deletions
-
other/java/client/src/main/java/seaweedfs/client/SeaweedInputStream.java
|
|
@ -6,6 +6,7 @@ import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
|
|
import java.io.EOFException; |
|
|
|
import java.io.FileNotFoundException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.nio.ByteBuffer; |
|
|
@ -34,6 +35,10 @@ public class SeaweedInputStream extends InputStream { |
|
|
|
this.entry = filerClient.lookupEntry( |
|
|
|
SeaweedOutputStream.getParentDirectory(fullpath), |
|
|
|
SeaweedOutputStream.getFileName(fullpath)); |
|
|
|
if(entry == null){ |
|
|
|
throw new FileNotFoundException(); |
|
|
|
} |
|
|
|
|
|
|
|
this.contentLength = SeaweedRead.fileSize(entry); |
|
|
|
|
|
|
|
this.visibleIntervalList = SeaweedRead.nonOverlappingVisibleIntervals(filerClient, entry.getChunksList()); |
|
|
|