<commit_before>/**
 * Copyright (c) <NAME>, 2014
 * alessandro[at]perucchi[dot]org
 * All Rights Reserved
 * Eclipse Public License (EPLv1)
 * http://oshi.codeplex.com/license
 */
package oshi.software.os.linux;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Scanner;

import oshi.software.os.OperatingSystem;
import oshi.software.os.OperatingSystemVersion;
import oshi.software.os.linux.proc.OSVersionInfoEx;

/**
 * Linux is a family of free operating systems most commonly used on personal
 * computers.
 * 
 * @author alessandro[at]perucchi[dot]org
 */
public class LinuxOperatingSystem implements OperatingSystem {

	private OperatingSystemVersion _version = null;
	private String _manufacturer = null;

	public OperatingSystemVersion getVersion() {
		if (_version == null) {
			_version = new OSVersionInfoEx();
		}
		return _version;
	}

	public String getManufacturer() {
		return "GNU/Linux";
	}

	public String getFamily() {
		if (_manufacturer == null) {
			Scanner in;
			try {
				in = new Scanner(new FileReader("/etc/os-release"));
			} catch (FileNotFoundException e) {
				return "";
			}
			in.useDelimiter("\n");
			while (in.hasNext()) {
				String[] splittedLine = in.next().split("=");
				if (splittedLine[0].equals("NAME")) {
					_manufacturer = splittedLine[1];
					break;
				}
			}
			in.close();
		}
		return _manufacturer;
	}<commit_msg>LinuxOperatingSystem#getFamily() removed starting and trailing '"' characters, e.g. "Ubuntu" => Ubuntu<commit_after>/**
 * Copyright (c) <NAME>, 2014
 * alessandro[at]perucchi[dot]org
 * All Rights Reserved
 * Eclipse Public License (EPLv1)
 * http://oshi.codeplex.com/license
 */
package oshi.software.os.linux;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Scanner;

import oshi.software.os.OperatingSystem;
import oshi.software.os.OperatingSystemVersion;
import oshi.software.os.linux.proc.OSVersionInfoEx;

/**
 * Linux is a family of free operating systems most commonly used on personal
 * computers.
 *
 * @author alessandro[at]perucchi[dot]org
 */
public class LinuxOperatingSystem implements OperatingSystem {

	private OperatingSystemVersion _version = null;
	private String _manufacturer = null;

	public String getFamily() {
		if (_manufacturer == null) {
			Scanner in;
			try {
				in = new Scanner(new FileReader("/etc/os-release"));
			} catch (FileNotFoundException e) {
				return "";
			}
			in.useDelimiter("\n");
			while (in.hasNext()) {
				String[] splittedLine = in.next().split("=");
				if (splittedLine[0].equals("NAME")) {
					// remove beginning and ending '"' characters, etc from
					// NAME="Ubuntu"
					_manufacturer = splittedLine[1].replaceAll("^\"|\"$", "");
					break;
				}
			}
			in.close();
		}
		return _manufacturer;
	}

	public String getManufacturer() {
		return "GNU/Linux";
	}

	public OperatingSystemVersion getVersion() {
		if (_version == null) {
			_version = new OSVersionInfoEx();
		}
		return _version;
	}
{'fraction_non_alphanumeric': 0.13211314475873545, 'fraction_numerical': 0.004658901830282862, 'mean_word_length': 3.968595041322314, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5830659', 'n_tokens_mistral': 1111, 'n_tokens_neox': 946, 'n_words': 224}