I think it is better here to convert to a URI and then do a getPath