response.sendFile with absolute paths

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

response.sendFile with absolute paths

tomaslin
Not sure if this is a bug.

I am writing files to my /tmp/ directory with phantomjs hoping to be able to serve them via ratpack.

When I call:

response.sendFile "image/png", file("/tmp/foodbar.png")

I get

java.io.FileNotFoundException: /home/action/workspace/google-font-to-image/src/ratpack/tmp/foodbar.png (No such file or directory)

Is there a flag or something that I'm not using?
Reply | Threaded
Open this post in threaded view
|

Re: response.sendFile with absolute paths

tomaslin
nvm

wrap handler with

fileSystem('/'){
   
}

seems to do the trick
Reply | Threaded
Open this post in threaded view
|

Re: response.sendFile with absolute paths

Luke Daley
Administrator
In reply to this post by tomaslin
It is a bug. Can you raise an issue please.
Reply | Threaded
Open this post in threaded view
|

Re: response.sendFile with absolute paths

tomaslin