CAS cas = ae.newCAS();
// Create a file filter depending on the format
// to filter out all file which do not have the
// expected file ending
FileFilter fileFilter;
if (InputFormat.CAS.equals(inputFormat)) {
fileFilter = new FileFilter() {
public boolean accept(File file) {
return file.getName().endsWith(".xmi") || file.getName().endsWith(".xcas") ||
(inputRecursive && file.isDirectory());
}
};
}
else if (InputFormat.PLAIN_TEXT.equals(inputFormat)) {
fileFilter = new FileFilter() {
public boolean accept(File file) {
return file.getName().endsWith(".txt") || (inputRecursive && file.isDirectory());
}
};