Skip to content

fixed https://github.com/grails-plugins/grails-resources/issues/62 #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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