Use fullPath and name getters instead of getPath() and getName().