Make the String input argument for the path as final to prevent mutability

Make the String input argument for the path as final to prevent mutability in compile time to
help reduce re-assignment error by not modifying input argument to be used as local variable.

The patch also clean some potential code confusion:
1. Remove useless return statement in the catch when it is the end of method.
2. Remove local variable for fid and just return directly since it is protected by
   try-catch that we do not need to handle due to IO issue.
I will leave the changes to other input args as separate PR if it is ok. The main reason I made path to be final is because it is modified in the methods to be cleaned. This is prone to error. Other input args seemed to be used directly without modification.