- if (file.getName().endsWith(".txt")) {
- file = new File(file.getPath().substring(0,
- file.getPath().length() - 4));
+ for (String ext : new String[] { ".txt", ".text" }) {
+ if (file.getName().endsWith(ext)) {
+ file = new File(file.getPath().substring(0,
+ file.getPath().length() - ext.length()));
+ }