Skip to content
Snippets Groups Projects
Commit a3608efb authored by Vincent Massol's avatar Vincent Massol Committed by Marius Dumitru Florea
Browse files

XWIKI-21211: Upgrade the standalone packaging to Jetty 12.x

* getRealPath() now returns null when the path doesn't exist (used to return non-existing paths with Jetty 10)

(cherry picked from commit 42b4147e)
parent 83e74f41
No related branches found
No related tags found
No related merge requests found
......@@ -473,12 +473,18 @@ private static void deleteDirectory(File directory)
private static void addSkinToZip(String skinName, ZipOutputStream out, Collection<String> exportedSkinFiles,
XWikiContext context) throws IOException
{
File file = new File(context.getWiki().getEngineContext().getRealPath("/skins/" + skinName));
// Protect against non-existing skins.
String realPath = context.getWiki().getEngineContext().getRealPath("/skins/" + skinName);
if (realPath != null) {
File file = new File(realPath);
// Don't include vm and LESS files by default
FileFilter filter = new NotFileFilter(new SuffixFileFilter(new String[] { ".vm", ".less", "skin.properties" }));
// Don't include vm and LESS files by default
FileFilter filter =
new NotFileFilter(new SuffixFileFilter(new String[]{ ".vm", ".less", "skin.properties" }));
addDirToZip(file, filter, out, "skins" + ZIPPATH_SEPARATOR + skinName + ZIPPATH_SEPARATOR, exportedSkinFiles);
addDirToZip(file, filter, out, "skins" + ZIPPATH_SEPARATOR + skinName + ZIPPATH_SEPARATOR,
exportedSkinFiles);
}
}
/**
......
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