use File.extname to determine extension.
Merge pull request #525 from ontohub/520-file_extension_determination

use File.extname to determine extension.