def get_file_type(path):
    """ Get file type for path. """
    if path.endswith('.jp2'):
        return 'jp2'
    if path.endswith('.tif'):
        return 'tiff'
    if '/alto/' in path:
        if path.endswith('.xml'):
            return 'alto'
        return None
    if '/casemets/' in path:
        if path.endswith('.xml'):
            return 'casemets'
        return None
    if path.endswith('METS.md5'):
        return 'md5'
    if path.endswith('METS.xml'):
        return 'volmets'
    return None