Magic number and bug fixed
-
Bug fixed : I found a small problem in your code. It seems that no exception was send when a file was given as parameter of util.findMatch(...). Here is the problem in your code
<pre> if (file.length() < readSize) { readSize = (int) file.length(); } if (readSize == 0) { return ContentInfo.EMPTY_INFO; } </pre>file.length does not send an Exception if the file does not exist but 0L. Then, when the file does not exist, ContentInfo.EMPTY_INFO is returned. I added a condition to check the file is well readable (if it is readable then it exists). -
Feature I added the following method
public ContentInfo findMatch(final URL url) throws IOException -
Magic number I added the magic number for VOTABLE (http://www.ivoa.net/documents/VOTable/), XSD (I did not find a mime type), OGG (I do not know how to make the difference between sound and video)
-
MimeType I added the mime type for netcdf (I was not written with the magic number expression)
Sorry for the delay on this. If you can break these into individual PRs then I'll take them but I don't like to mix issues. I'm also happy to split them up myself. Thanks.