private IMDBEntry parse(BufferedReader reader) throws IOException { IMDBEntry entry = new IMDBEntry(); String line = reader.readLine(); while (line != null) { if (line.startsWith(ENTRY_TITLE)) { entry.setTitle(getValue(line)); } else if (line.startsWith(ENTRY_URL)) { entry.setImdbUrl(getValue(line)); } else if (line.startsWith(ENTRY_GENRES)) { String genres = getValue(line); List<String> genreList = Arrays.asList(genres.split(",")); entry.setGenres(genreList); } else if (line.startsWith(ENTRY_RATING)) { entry.setImdbRating(getValue(line)); } else if (line.startsWith(ENTRY_YEAR)) { entry.setYear(getValue(line)); } else if (line.startsWith(ENTRY_SERIES)) { entry.setSeries(Boolean.parseBoolean(getValue(line))); } line = reader.readLine(); } return entry; }