class VersionInfoLoader {

    public static List<VersionInfo> load() throws IOException {
        URL url = new URL(VERSION_TXT_URL);

        List<VersionInfo> versionInfo = new ArrayList<>();

        try (Scanner websiteScanner = new Scanner(url.openStream())) {
            while (websiteScanner.hasNextLine()) {
                checkLine(websiteScanner).ifPresent(lineParts -> {
                    boolean release = lineParts[0].equals("REL");
                    Version version = new Version(lineParts[1]);
                    String downloadUrl = lineParts[2];
                    String changeLogUrl = lineParts[3];

                    versionInfo.add(new VersionInfo(release, version, downloadUrl, changeLogUrl));
                });
            }
        }

        Collections.sort(versionInfo);
        return versionInfo;
    }

    private  VersionInfoLoader();

}