@RequestMapping(value = Constants.BASEURL_REST
+ "/static/add", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> addStaticResource(@PathVariable String siteUrl, @RequestPart("file") Part file, @RequestParam String path) {
String originalFileName = file.getSubmittedFileName();
if(originalFileName != null) {
try {
String fileName = fileSystemUtil.addStaticResource(getSite(siteUrl), path, file.getInputStream());
logger.debug("Static resource added successful: {}", fileName);
return Response.ok(fileName);
} catch (Exception e) {
return Response.error(e.getMessage());
}
} else {
return Response.error("Empty file.");
}
}
SiteAdminController.java 文件源码
java
阅读 38
收藏 0
点赞 0
评论 0
项目:bacoma
作者:
评论列表
文章目录