I need to extract the physical path of the resource folder in order to write the file from my controller.
Any short way to achieve file resilience from the controller?
Take a look at the AssetProcessorService inside the plugin. There are various functions for getting the path, such as getAssetPath or getResolvedAssetPath . This might help you.
Complete example:
class ExampleService { def assetResourceLocator def someMethod() { Resource res = assetResourceLocator.findAssetForURI('test.css') String url = res.getURL() String uri = res.getURI() } }
Source: fooobar.com/questions/2251032 / ...