whats a good method of checking the file is a zip file, apart from checking the extension (toLower)
checking the mime type didn't work as it gave application/octect (as did word docs)
I need to make sure file type is zip, before I do anything with it there are many good java resources for zip, but cant find a good file type check
heres my mime method that didn't work: (or showed there wasn't a difference between mime types for zip files and word files)
private void listAllzipfiles(String folderlocation){
File folder = new File(folderlocation);
File[] listOfFiles = folder.listFiles();
for (int i = 0; i < listOfFiles.length; i++) {
if (listOfFiles[i].isFile()) {
File file = new File(listOfFiles[i].getName());
System.out.println("File " + listOfFiles[i].getName());
String MimeTypeOfFile = new MimetypesFileTypeMap().getContentType(file);
System.out.println("Type " + MimeTypeOfFile);
} else if (listOfFiles[i].isDirectory()) {
System.out.println("Directory " + listOfFiles[i].getName());
}
}