- if (absPath != null && new File(absPath + ext).exists()) {
- url = new File(absPath + ext).toURI().toURL();
- } else if (relPath != null
- && new File(relPath + ext).exists()) {
- url = new File(relPath + ext).toURI().toURL();
+ File absFile = new File(absPath + ext);
+ File relFile = new File(relPath + ext);
+ if (absPath != null && absFile.exists()
+ && absFile.isFile()) {
+ url = absFile.toURI().toURL();
+ } else if (relPath != null && relFile.exists()
+ && relFile.isFile()) {
+ url = relFile.toURI().toURL();