Get the compression-free extension for this filename. @param filename The filename to check @return an extension, skipping past .gz if it's present
(String filename)
| 6869 | * @return an extension, skipping past .gz if it's present |
| 6870 | */ |
| 6871 | static public String checkExtension(String filename) { |
| 6872 | // Don't consider the .gz as part of the name, createInput() |
| 6873 | // and createOuput() will take care of fixing that up. |
| 6874 | if (filename.toLowerCase().endsWith(".gz")) { |
| 6875 | filename = filename.substring(0, filename.length() - 3); |
| 6876 | } |
| 6877 | int dotIndex = filename.lastIndexOf('.'); |
| 6878 | if (dotIndex != -1) { |
| 6879 | return filename.substring(dotIndex + 1).toLowerCase(); |
| 6880 | } |
| 6881 | return null; |
| 6882 | } |
| 6883 | |
| 6884 | |
| 6885 |