the subdir element needs to be included otherwise certain xmlbean operations (e.g. selectPath) can't find the corresponding xmlbeans classes

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1640846 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2014-11-21 01:06:39 +00:00
parent 284e328f11
commit b5288cf29e
1 changed files with 3 additions and 1 deletions

View File

@ -32,6 +32,7 @@ import java.util.Map;
import java.util.Vector;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.regex.Pattern;
import junit.framework.TestCase;
@ -133,10 +134,11 @@ public final class OOXMLLite {
//finally copy the compiled .xsb files
System.out.println("Copying .xsb resources");
JarFile jar = new JarFile(_ooxmlJar);
Pattern p = Pattern.compile("schemaorg_apache_xmlbeans/(system|element)/.*\\.xsb");
try {
for(Enumeration<JarEntry> e = jar.entries(); e.hasMoreElements(); ){
JarEntry je = e.nextElement();
if(je.getName().matches("schemaorg_apache_xmlbeans/system/\\w+/\\w+\\.xsb")) {
if(p.matcher(je.getName()).matches()) {
File destFile = new File(_destDest, je.getName());
copyFile(jar.getInputStream(je), destFile);
}