本文整理汇总了Java中play.api.mvc.AnyContent类的典型用法代码示例。如果您正苦于以下问题:Java AnyContent类的具体用法?Java AnyContent怎么用?Java AnyContent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnyContent类属于play.api.mvc包,在下文中一共展示了AnyContent类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWrappedRequest
import play.api.mvc.AnyContent; //导入依赖的package包/类
@SuppressWarnings(value = "unchecked")
public play.api.mvc.Request<play.mvc.Http.RequestBody> getWrappedRequest() {
return ((play.api.test.FakeRequest<play.api.mvc.AnyContent>)fake).map(new scala.runtime.AbstractFunction1<play.api.mvc.AnyContent, play.mvc.Http.RequestBody>() {
public play.mvc.Http.RequestBody apply(play.api.mvc.AnyContent anyContent) {
return new play.core.j.JavaParsers.DefaultRequestBody(
anyContent.asFormUrlEncoded(),
anyContent.asRaw(),
anyContent.asText(),
anyContent.asJson(),
anyContent.asXml(),
anyContent.asMultipartFormData(),
false
);
}
});
}
示例2: create
import play.api.mvc.AnyContent; //导入依赖的package包/类
public static void create(long duration, LogCategory logCategory, Request<AnyContent> request, String text) {
if (Global.isPerformanceLogging() == true) {
PerformanceLog result = new PerformanceLog();
result.duration = duration;
abstractCreate(result, logCategory, LogLevel.INFO, request, new LinkedList<AbstractModel>());
if (text != null) {
result.httpUrl += " - " + text;
}
Neo4JServiceProvider.get().performanceLogRepository.save(result);
} else {
String requestString = logCategory.toString();
if (request != null) {
requestString += " " + request.uri();
}
if (text != null) {
requestString += " - " + text;
}
Logger.info(requestString + " took " + duration + " ms");
}
}
示例3: at
import play.api.mvc.AnyContent; //导入依赖的package包/类
@SunriseRoute(AssetsReverseRouter.ASSET)
public Action<AnyContent> at(String file) {
return super.at(file);
}
示例4: convert
import play.api.mvc.AnyContent; //导入依赖的package包/类
public static BridgeRequest convert(final Request<AnyContent> request){
return new ScalaBridgeRequest(request);
}
示例5: at
import play.api.mvc.AnyContent; //导入依赖的package包/类
public static Action<AnyContent> at (final String path, final String file) {
return controllers.Assets.at (path, getLang ().language () + "/" + file, false);
}
示例6: at
import play.api.mvc.AnyContent; //导入依赖的package包/类
public static Action<AnyContent> at(String path, String file)
{
return controllers.Assets.at(path, file);
}
示例7: at
import play.api.mvc.AnyContent; //导入依赖的package包/类
public static Action<AnyContent> at(String path, String file) {
return controllers.Assets.at(path, file, false);
}
示例8: withAnyContent
import play.api.mvc.AnyContent; //导入依赖的package包/类
/**
* Set a AnyContent to this request.
* @param content the AnyContent
* @param contentType Content-Type header value
* @param method The method to be set
* @return the Fake Request
*/
public FakeRequest withAnyContent(AnyContent content, String contentType, String method) {
Map<String, Seq<String>> map = new HashMap<String, Seq<String>>(Scala.asJava(fake.headers().toMap()));
map.put("Content-Type", Scala.toSeq(new String[] {contentType}));
fake = new play.api.test.FakeRequest(method, fake.uri(), new play.api.test.FakeHeaders(Scala.asScala(map).toSeq()), content, fake.remoteAddress(), fake.version(), fake.id(), fake.tags());
return this;
}
示例9: body
import play.api.mvc.AnyContent; //导入依赖的package包/类
public AnyContent body();