diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2021-05-06 10:35:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-06 10:35:44 -0700 |
| commit | 48601bce6c3d59c2931a288b17f6d6609d5a5666 (patch) | |
| tree | 98f80ac0e0732f5370c15732b1ef2a68cf4565c0 /other/java/client | |
| parent | aaad4b578b37accd240686ab08cb9980dfe6a13a (diff) | |
| parent | 9c97b172913f112425fad70593202f71f86e14eb (diff) | |
| download | seaweedfs-48601bce6c3d59c2931a288b17f6d6609d5a5666.tar.xz seaweedfs-48601bce6c3d59c2931a288b17f6d6609d5a5666.zip | |
Merge pull request #2050 from jbarotin/master
make SeaweedInputStream throw FileNotFoundException
Diffstat (limited to 'other/java/client')
| -rw-r--r-- | other/java/client/src/main/java/seaweedfs/client/SeaweedInputStream.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/other/java/client/src/main/java/seaweedfs/client/SeaweedInputStream.java b/other/java/client/src/main/java/seaweedfs/client/SeaweedInputStream.java index 4e40ce1b6..6097b8d56 100644 --- a/other/java/client/src/main/java/seaweedfs/client/SeaweedInputStream.java +++ b/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()); |
