Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jze committed Jan 13, 2017
1 parent b3977b2 commit 46c5d74
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ class ResourceProcessor implements InitializingBean, ServletContextAware {
File makeFileForURI(String uri) {
def splitPoint = uri.lastIndexOf('/')
def fileSystemDir = splitPoint > 0 ? makeFileSystemPathFromURI(uri[0..splitPoint - 1]) : ''
def fileSystemFile = makeFileSystemPathFromURI(uri[splitPoint + 1..-1])
def fileSystemFile = uri.length() <= splitPoint+1? '': makeFileSystemPathFromURI(uri[splitPoint + 1..-1])
def staticDir = new File(getWorkDir(), fileSystemDir)

// force the structure
Expand All @@ -583,7 +583,7 @@ class ResourceProcessor implements InitializingBean, ServletContextAware {
log.debug "Creating file object for URI [$uri] from [${staticDir}] and [${fileSystemFile}]"
File f = new File(staticDir, fileSystemFile)
// Delete the existing file - it may be from previous release, we cannot tell.
if (f.exists()) {
if (f.exists() && f.isFile()) {
assert f.delete()
}
return f
Expand Down

0 comments on commit 46c5d74

Please sign in to comment.