The code looks a little strange for when we warn (e.g. warn about data+key defined only if "unused" - is that so we only log once?).
And on IOException, we lose the cause - e.g. was it file not found or file permissions etc; I'd include `, e);` to log the exception as well.