BUG-731: do not declare Exception to be thrown

These 7 methods either throw only a subclass of RuntimeException,
or IOException. Declare them accordingly.

Change-Id: I253e659dde725df004f63f156448591ef5e85bbb
Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-731: do not use temporary variables

These are single-use and can be easily simplified, so get rid of them.

Change-Id: I50c074fa184f59cfe39df34af05c60b20f6b035a
Signed-off-by: Robert Varga <rovarga@cisco.com>