@Nullable
    private static String readAttributionFromMapFileIfValid(final String mapFileCtx, final InputStream mapStream) {

        MapFile mapFile = null;
        try {
            mapFile = createMapFile(mapFileCtx, mapStream);
            if (mapFile != null && mapFile.getMapFileInfo() != null && mapFile.getMapFileInfo().fileVersion <= 5) {
                if (StringUtils.isNotBlank(mapFile.getMapFileInfo().comment)) {
                    return mapFile.getMapFileInfo().comment;
                }
                if (StringUtils.isNotBlank(mapFile.getMapFileInfo().createdBy)) {
                    return mapFile.getMapFileInfo().createdBy;
                }
                //map file is valid but has no attribution -> return default value
                return OFFLINE_MAP_DEFAULT_ATTRIBUTION;
            }
        } catch (MapFileException ex) {
            Log.w(String.format("Exception reading mapfile '%s'", mapFileCtx), ex);
        } finally {
            closeMapFileQuietly(mapFile);
        }
        return null;
    }
Tries to open given uri as a mapfile.
If mapfile is invalid in any way (not available, not readable, wrong version, ...), then null is returned.
If mapfile is valid, then its attribution is read and returned (or a default attribution value in case attribution is null)
main/src/main/java/cgeo/geocaching/maps/mapsforge/MapsforgeMapProvider.java