Tests if the file suffix of a path matches the specified suffixes. @param path path @param suffixes suffixes to compare with @return result of check
(final String path, final String... suffixes)
| 351 | * @return result of check |
| 352 | */ |
| 353 | public static boolean checkSuffix(final String path, final String... suffixes) { |
| 354 | final int i = path.lastIndexOf('.'); |
| 355 | if(i == -1) return false; |
| 356 | final String suf = path.substring(i).toLowerCase(Locale.ENGLISH); |
| 357 | for(final String suffix : suffixes) { |
| 358 | if(suf.equals(suffix)) return true; |
| 359 | } |
| 360 | return false; |
| 361 | } |
| 362 | |
| 363 | /** |
| 364 | * Writes data from an input stream to an output stream. |