Code example for InvalidPreferencesFormatException

    private String readTill(String s)
                    throws InvalidPreferencesFormatException 
        int index = line.indexOf(s);
        if (index == -1)
                throw new InvalidPreferencesFormatException(s + " not found");
        String read = line.substring(0, index);
        line = line.substring(index+s.length());
        return read;
    private String nextTag()
                    throws InvalidPreferencesFormatException, IOException 
        while(true) { 
            if (line == null)
                throw new InvalidPreferencesFormatException("unexpected EOF");
Connect your IDE to all the code out there  Get Codota for Java