Grails plugin that allows you to serve files from any directory on disk.
Groovy HTML CSS
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
grails-app
test
.gitignore
FileServerGrailsPlugin.groovy
README.md
application.properties

README.md

grails-file-server

Grails 2.x plugin that allows you to serve files from any directory on disk.

Add dependency to grails-app/conf/BuildConfig.groovy:

grails.project.dependency.resolution = {
    ...
    plugins {
        ...
        runtime ':file-server:0.2.1'
    }
}

Add download controller provided by this plugin to grails-app/conf/UrlMappings.groovy:

class UrlMappings {
    static mappings = {
        "/download/$root/$path**"(controller: "download")
    }
}

Add all directories you want to serve files from to grails-app/conf/Config.groovy:

grails.plugins.fileserver.paths=[
    "root1": "/path/to/dir1",
    "root2": "/path/to/dir2"
]

For more information check plugins's documentation: https://github.com/pdorobisz/grails-file-server/wiki