Browse Source

Revert "user guide path fix"

This reverts commit bd15b1e2c7.
master
Diamantis Tziotzios 5 months ago
parent
commit
895dbcf098
  1. 7
      dmp-backend/web/src/main/java/eu/eudat/controllers/UserGuideController.java
  2. 2525
      user-guide/UserGuide_pt.html

7
dmp-backend/web/src/main/java/eu/eudat/controllers/UserGuideController.java

@ -50,12 +50,13 @@ public class UserGuideController {
}
InputStream is = new FileInputStream(fileName);
Path path = Paths.get(fileName);
String[] filepath = fileName.split("\\.")[0].split("\\\\");
String simplename = filepath[filepath.length - 1];
HttpHeaders responseHeaders = new HttpHeaders();
responseHeaders.setContentLength(is.available());
responseHeaders.setContentType(MediaType.TEXT_HTML);
responseHeaders.set("Content-Disposition", "attachment;filename=" + path.getFileName().toString());
responseHeaders.set("Content-Disposition", "attachment;filename=" + simplename);
responseHeaders.set("Access-Control-Expose-Headers", "Content-Disposition");
responseHeaders.get("Access-Control-Expose-Headers").add("Content-Type");
@ -70,7 +71,7 @@ public class UserGuideController {
@RequestMapping(value = "current", method = RequestMethod.POST)
public @ResponseBody
ResponseEntity<ResponseItem<String>> updateGuide(@RequestBody UserGuide guide, @ClaimedAuthorities(claims = {ADMIN}) Principal principal) throws Exception {
String fileName = this.environment.getProperty("userguide.path") + guide.getName();
String fileName = this.environment.getProperty("userguide.path") + guide.getName() + ".html";
OutputStream os = new FileOutputStream(fileName);
os.write(guide.getHtml().getBytes());
os.close();

2525
user-guide/UserGuide_pt.html

File diff suppressed because it is too large
Loading…
Cancel
Save