Skip to content
Snippets Groups Projects
Commit facd35a7 authored by srosse's avatar srosse
Browse files

OO-3463: better check exists of the physical file of a wiki page

parent 041d8e21
No related branches found
No related tags found
No related merge requests found
......@@ -152,8 +152,14 @@ public class Wiki implements WikiContainer, Serializable {
return page;
}
if (loadContent) {
VFSLeaf leaf = (VFSLeaf) pageContainer.resolve(page.getPageId() + "." + WikiManager.WIKI_FILE_SUFFIX);
page.setContent(FileUtils.load(leaf.getInputStream(), "utf-8"));
VFSItem item = pageContainer.resolve(page.getPageId() + "." + WikiManager.WIKI_FILE_SUFFIX);
if(item instanceof VFSLeaf) {
try(InputStream in = ((VFSLeaf)item).getInputStream()) {
page.setContent(FileUtils.load(in, "utf-8"));
} catch(Exception e) {
log.error("Cannot load wiki page: " + item, e);
}
}
}
return page;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment