File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
grails-bootstrap/src/main/groovy/grails/io Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -248,12 +248,16 @@ class IOUtils extends SpringIOUtils {
248248 def rootResource = findRootResource(targetClass)
249249 if (rootResource != null ) {
250250
251- def rootFile = new UrlResource (rootResource). file. canonicalFile
251+ try {
252+ def rootFile = new UrlResource (rootResource). file. canonicalFile
253+ def rootPath = rootFile. path
254+ def buildClassespath = BuildSettings . BUILD_CLASSES_PATH . replace(' /' , File . separator)
255+ if (rootPath. contains(buildClassespath)) {
256+ return new File (rootPath - buildClassespath)
252257
253- def rootPath = rootFile. path
254- def buildClassespath = BuildSettings . BUILD_CLASSES_PATH . replace(' /' , File . separator)
255- if (rootPath. contains(buildClassespath)) {
256- return new File (rootPath - buildClassespath)
258+ }
259+ } catch (FileNotFoundException fnfe) {
260+ return null
257261 }
258262 }
259263 return null
You can’t perform that action at this time.
0 commit comments