String renameFileInPath(String newName) { return substring(0, lastIndexOf(Platform.pathSeparator) + 1) + newName; }