A quick google search (for the admittedly non-obvious) “java magic file detection” brings up a fairly nice looking article, “Get the Mime Type from a File” which suggests you use one of the following:
More Related Contents:
- File not found in Java [duplicate]
- Write byte array to file in java
- How to move elements of Java ArrayList to file in java [closed]
- How do I create a Java string from the contents of a file?
- Rename a file using Java
- How to construct a relative path in Java from two absolute paths (or URLs)?
- Best way to list files in Java, sorted by Date Modified?
- Java NIO FileChannel versus FileOutputstream performance / usefulness
- Reading UTF-8 – BOM marker
- Java sending and receiving file (byte[]) over sockets
- When should I use File.separator and when File.pathSeparator?
- byte[] to file in Java
- Java: Find .txt files in specified folder
- Find place for dedicated application folder
- Elegant way to read file into byte[] array in Java [duplicate]
- What is the difference between Reader and InputStream?
- HowTo extract MimeType from a byte[] [duplicate]
- Writing in the beginning of a text file Java
- Java: splitting the filename into a base and extension
- how to drag and drop files from a directory in java
- Get file name from URL
- How to open user system preferred editor for given file?
- java IO to copy one File to another
- Reading Windows file summary properties (title, subject, author) in Java
- Find files in a folder using Java
- How to check a file if exists with wildcard in Java?
- Selenium WebDriver: Upload multiple files
- The system cannot find the file specified in java
- JavaFX FileChooser Throws Error (probably easy fix, but still confused)
- How to reference a File in raw folder in Android