move check if a file should be encrypted to the pre hook
don't call getFileInfo() to avoid to open the same file twice
Merge pull request #7912 from owncloud/enc_move_checks_to_pre_hook

move check if a file should be encrypted to the pre hook