How about using available methods like **getAbsolutePath()** and **oldFile.getName()**

  String fullNewName= fileName.getAbsolutePath().replace(fileName.getName(),newName);