import re


def get_package(fname):
    """
    get the package this java file is in
    """
    with open(fname, "r", errors = "ignore") as infile:
        lines = infile.readlines();
        for line in lines:
            m = re.search('package\s+(.+?);', line);
            if m is not None:
                package = m.group(1);
                return package;