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)
| 6087 | * @return an extension, skipping past .gz if it's present |
| 6088 | */ |
| 6089 | static public String checkExtension(String filename) { |
| 6090 | // Don't consider the .gz as part of the name, createInput() |
| 6091 | // and createOutput() will take care of fixing that up. |
| 6092 | if (filename.toLowerCase().endsWith(".gz")) { |
| 6093 | filename = filename.substring(0, filename.length() - 3); |
| 6094 | } |
| 6095 | int dotIndex = filename.lastIndexOf('.'); |
| 6096 | if (dotIndex != -1) { |
| 6097 | return filename.substring(dotIndex + 1).toLowerCase(); |
| 6098 | } |
| 6099 | return null; |
| 6100 | } |
| 6101 | |
| 6102 | |
| 6103 |