Nov 5, 2017

How to check file suffix of Java Path

Path.endsWith(String) will ONLY match another sub-element of Path object in your original path, not the path name string portion.

So you can use such as:
path.toString().toLowerCase().endsWith(".xlsx");

to check the file suffix.