Handle directories in updateFile().

Change-Id: Ifd044e642ae8c3fdc614e939e5dca9b55c91db52
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>