private void parseFile() {

		Exception exception = null;
		FileReader fileReader = null;
		BufferedReader bufferedReader = null;
		try {
			fileReader = new FileReader(this.filePath);
			bufferedReader = new BufferedReader(fileReader);
			this.numberOfParticipants = Integer.parseInt(bufferedReader
					.readLine());
			this.people = new Person[this.numberOfParticipants];
			this.pets = new Pet[this.numberOfParticipants];

			for (int i = 0; i < this.people.length; i++) {
				this.people[i] = new Person();
			}

			for (int i = 0; i < this.pets.length; i++) {
				this.pets[i] = new Pet();
			}

			setNamesAndPreferences(this.people, bufferedReader);
			setNamesAndPreferences(this.pets, bufferedReader);

		} catch (FileNotFoundException e) {
			System.out.println("Invalid file path or name.");
			exception = e;
		} catch (NumberFormatException e) {
			System.out
					.println("Invalid data in input file, number is expected.");
			exception = e;
		} catch (IOException e) {
			System.out.println("Cannot read the file, I/O Exception occurred.");
			exception = e;
		} finally {
			try {
				if (fileReader != null) {
					fileReader.close();
				}

				if (bufferedReader != null) {
					bufferedReader.close();
				}

			} catch (IOException e) {
				System.out.println("Cannot close file or buffered reader.");
				exception = e;
			}

			if (exception != null) {
				System.exit(1);
			}
		}
	}