Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

java - Validation of a MIME type

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...