I'm trying the following to create a File:
java.io.File myFile = play.Application.getFile("/public/myFiles/myFile.txt");
which is causing the error:
non-static method getFile(java.lang.String) cannot be referenced from a static context
how do use the getFile method to return what I want?
getFile
isn't a static method so you need to reference it from an instance of Application
.
This should work to get you the current Application
instance:
Play.application().getFile(...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With