If a path is expected then should you not convert to a uri (getUri from the file) and then call getPath?