catch (MalformedPatternException e) {
System.out.println("Fehler beim Parsen der Filterdatei :\n" + e);
}
PatternCompiler compiler = new Perl5Compiler();
PatternMatcher matcher = new Perl5Matcher();
while (fileList.hasMoreElements()) {
FileListElement file = (FileListElement)fileList.nextElement();
Enumeration filterEnum = filter.elements();
Pattern pathPattern = null;
Pattern filenamePattern = null;
while (filterEnum.hasMoreElements()) {
FilterElement filterElement = (FilterElement)filterEnum.nextElement();
try {
pathPattern = compiler.compile(filterElement.getPathPattern());
filenamePattern = compiler.compile(filterElement.getFilenamePattern());
} catch (MalformedPatternException e) {
System.out.println("Fehler im Pattern\n" + e);
}
if (matcher.matches(file.getPath(),pathPattern) && matcher.matches(file.getFilename(),filenamePattern))
file.setInclude(filterElement.isInclude());
}
}
starJar.zipFiles(fileListVector,"JarDirectoryTest.jar", "");
}