/**
* Bench the get picture file.
*
* @return the JAX-RS stream.
*/
@GET
@Path("picture.png")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
@OnNullReturn404
public StreamingOutput downloadLobFile() {
log.info("Picture download is requested");
final byte[] firstAvailableLob = jpaDao.getLastAvailableLob();
if (firstAvailableLob.length == 0) {
return null;
}
return output -> {
try {
IOUtils.write(firstAvailableLob, output);
} catch (final IOException e) {
throw new IllegalStateException("Unable to write the LOB data", e);
}
};
}
JpaBenchResource.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:bootstrap
作者:
评论列表
文章目录