/** * Method to check whether the imported file is a music file * * @param file: imported file * @return true: the imported file is a music file and otherwise */ public static boolean checkIfMusicFile(File file) { for (MusicFileType type : MusicFileType.values()) { if (file.getAbsolutePath().contains(MusicFileType.getFileExtension(type))) { return true; } } return false; }