I have to import data from an Excel file to database and to do this, I would like to check the extension of the chosen file.
This is my code:
String
following
extension != excel
should be
!excel.equals(extension)
or
!excel.equalsIgnoreCase(extension)
See also
In my programm i did that
if(file_name.endsWith(".xls") || file_name.endsWith(".xlsx")) // something works with file