Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magic number and bug fixed #29

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

J-Christophe
Copy link
Contributor

  • 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
    `

    if (file.length() < readSize) {
    readSize = (int) file.length();
    }
    if (readSize == 0) {
    return ContentInfo.EMPTY_INFO;
    }
` 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)

@j256
Copy link
Owner

j256 commented Jul 12, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants