Fix bug 329908: Throw exception if file can't be read in readFile()

git-svn-id: svn://10.0.0.236/trunk@255040 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hannes%helma.at
2008-11-14 14:05:55 +00:00
parent b0ae8632a6
commit 7b2463d3bd

View File

@@ -1037,7 +1037,11 @@ public class Global extends ImporterTopLevel
}
} else {
File f = new File(filePath);
if (!f.exists()) {
throw new FileNotFoundException("File not found: " + filePath);
} else if (!f.canRead()) {
throw new IOException("Cannot read file: " + filePath);
}
long length = f.length();
chunkLength = (int)length;
if (chunkLength != length)