我正在做类似于在泽西岛使用 StreamingOutput 作为响应实体的示例中提到的事情
@GET
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response streamExample(@Context UriInfo uriInfo) {
StreamingOutput stream = new StreamingOutput() {
@Override
public void write(OutputStream os) throws IOException,WebApplicationException {
try{
Writer writer = new BufferedWriter(new OutputStreamWriter(os));
//Read resource from jar
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("public/" + uriInfo.getPath());
...//manipulate the inputstream and build string with StringBuilder here//.......
String inputData = builder.toString();
Writer writer = new BufferedWriter(new OutputStreamWriter(os));
writer.write(inputData);
writer.flush();
} catch (ExceptionE1) {
throw new WebApplicationException();
}
}
};
return Response.ok(stream,MediaType.APPLICATION_OCTET_STREAM).build();
}
Run Code Online (Sandbox Code Playgroud)
我试图通过模拟 URIInfo …
Cobertura 是否已知用于 JavaScript 代码库中的代码覆盖率? http://cobertura.github.io/cobertura/说它是用于 Java 代码库的。
sap.ui.core.Title
和 之间的主要区别是sap.m.Title
什么?是否有特定的限制、约定甚至Fiori 指南何时使用哪个控件?
看起来 sap.m.Title 较新,但使用来自 sap.ui.core 的对象。