我们在Cloudbees上运行Play2应用程序,然后从'/ conf'目录(在应用程序的类路径内)加载一个文件.
这两个片段在本地和heroku工作
Play.application().getFile("conf/myfile.json")
Run Code Online (Sandbox Code Playgroud)
和
new File("conf/myfile.json")
Run Code Online (Sandbox Code Playgroud)
java.io.FileNotFoundException: /var/genapp/apps/..../conf/myfile.json (No such file or directory)
Run Code Online (Sandbox Code Playgroud)
那么如何在Cloudbees上从classpath加载文件?
我是MongoDB的新手,我正在尝试使用聚合.我部分地做了我正在寻找的但是我对日期有一种奇怪的行为.
MongoDB信息
版本:2.2.0
操作系统:Windows 7
目的
获取"2012-11-22"之后创建的所有评论
我们来举个例子:
数据
db.blogs.save([ {
title : "X this is my second title",
author : "max",
posted : new Date(),
pageViews : 10,
tags : [ "good", "nice" ],
comments : [ {
"_id" : ObjectId("50ac9fdb53a900bcb4be46d9"),
author : "john",
text : "pretty awesome",
create : ISODate("2012-12-20T00:00:00.000Z")
}, {
"_id" : ObjectId("50ac9fd003a900bcb4be46d9"),
author : "sam",
text : "this is bad",
create : ISODate("2012-12-22T00:00:00.000Z")
} ],
other : {
foo : 5
}
}, {
title …Run Code Online (Sandbox Code Playgroud)