Skip to content

Commit

Permalink
Skip missing files when reading a Multifile container
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Stuedi committed May 25, 2017
1 parent 82b0315 commit 5f1d0df
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class MultiFileBufferedInputStream extends CrailBufferedInputStream {
public CrailInputStream getStream() throws Exception {
while(readyStreams.isEmpty() && paths.hasNext()){
String path = paths.next();
CrailFile file = fs.lookup(path).get().asFile();
if (file == null){
throw new Exception("File not found, name " + path);
}
if (file.getCapacity() > 0){
CrailInputStream stream = file.getDirectInputStream(file.getCapacity());
readyStreams.add(stream);
CrailNode node = fs.lookup(path).get();
if (node != null){
CrailFile file = node.asFile();
if (file.getCapacity() > 0){
CrailInputStream stream = file.getDirectInputStream(file.getCapacity());
readyStreams.add(stream);
}
}
}
return readyStreams.peek();
Expand Down

0 comments on commit 5f1d0df

Please sign in to comment.