I want to write a method that receives the data to create a file, e.g.,
public File createFile(String fileName, String mimeType, byte[] contents)
In that method, how can I check that the value of mimeType
is acceptable? JDK 7 javax.activation.MimeType
class and Apache Tika do not seem to provide such a check method or any list of known mime types.
Thanks in advance for any clue.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…