/** * Write the given ShortDefinition in a File $ShortcutName-$timestamp.desktop in the given * TargetPath. If the given replaceSpaces was true ALSO all WhiteSpaces in the ShortCutName will * be replaced with "-" * * @param targetPath The Path in which the files should be written. * @param shortcutName The Name for the File * @param shortcutDef The Shortcut FileContent * @return The written File */ private File writeAppShortcutWithSimpleSpacehandling(String targetPath, String shortcutName, String shortcutDef, boolean replaceSpacesWithMinus) { File shortcutFile = new File( FilenameUtils.getFullPathNoEndSeparator(targetPath) + '/' + (replaceSpacesWithMinus ? StringTool.replaceSpacesWithMinus(shortcutName) : shortcutName) + DESKTOP_EXT); try { FileUtils.writeStringToFile(shortcutFile, shortcutDef); } catch (IOException e) { logger.warning("Application shortcut could not be created (" + e.getMessage() + ")"); } return shortcutFile; }