title: Checking type of a file (csv or excel file(xlsx)) in java
body: <p>I need to upload a file. Before I upload it, I need to know if the file is either csv or excel file(xlsx). If it is csv or excel file I will continue else exit.
  How can I know the type of a file in java by using its path.</p>