What we do :
We run Play2 application on Cloudbees and we load a file from '/conf' directory (inside the classpath of the application).
These 2 snippets work in local and at heroku
Play.application().getFile("conf/myfile.json")
and
new File("conf/myfile.json")
However, on Cloudbees, we get FileNotFoundException :
java.io.FileNotFoundException: /var/genapp/apps/..../conf/myfile.json (No such file or directory)
So how to load a file from classpath on Cloudbees?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…