Check if uri is a file path before open it.