Commit cb888dda authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '114-asciidoc-missing-images' into 'master'

Asciidoc missing images

Closes #114

See merge request !40
parents c097f26c ab8349f6
......@@ -22,7 +22,6 @@ public class AsciiDocController extends BaseController {
private static final String DOCS_SECTIONS_DIR = "sections/";
private static final String DOCS_IMAGES_DIR = "images/";
private static final String HTML_EXTENSION = ".html";
private static final String PNG_EXTENSION = ".png";
@RequestMapping("/0/{documentName}")
public String viewDoc(ModelMap model, @PathVariable(value = "documentName") String documentName) throws IOException {
......@@ -74,8 +73,7 @@ public class AsciiDocController extends BaseController {
@ResponseBody
public byte[] getImage(@PathVariable(value = "imageName") String imageName) throws IOException {
ClassLoader classLoader = this.getClass().getClassLoader();
String imgPath = new StringBuilder(DOCS_DIR).append(DOCS_IMAGES_DIR)
.append(imageName).append(PNG_EXTENSION).toString();
String imgPath = new StringBuilder(DOCS_DIR).append(DOCS_IMAGES_DIR).append(imageName).toString();
InputStream inputStream = classLoader.getResourceAsStream(imgPath);
if (inputStream == null) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment