Checks if the given file is a PCGen character file based on the file extension. @param file the file to test @return {true} if the file exists and is a PCGen character file @see Constants#EXTENSION_CHARACTER_FILE
(final File file)
| 44 | * @see Constants#EXTENSION_CHARACTER_FILE |
| 45 | */ |
| 46 | public static boolean isPCGenCharacterFile(final File file) |
| 47 | { |
| 48 | // A directory strangely named "fred.pcg" is not a character file. |
| 49 | if (!file.isFile()) |
| 50 | { |
| 51 | return false; |
| 52 | } |
| 53 | |
| 54 | return getWindowsSafeFilename(file).endsWith(Constants.EXTENSION_CHARACTER_FILE); |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Checks if the given {@code file} is a PCGen party file based on the file |