public static void renameSkin(String filename, String newName) {
        if ((newName != null) && !newName.equals("") && !filename.equals(newName)) {
            Path skinPath;
            if (!filename.endsWith(Constants.SKINFILE_SUFFIX)) {
                skinPath = Constants.PROGRAM_SKINS_PATH.resolve(filename + Constants.SKINFILE_SUFFIX);
            } else {
                skinPath = Constants.PROGRAM_SKINS_PATH.resolve(filename);
            }

            saveAs(model.loadSkin(skinPath), newName);
            deleteSkin(filename);
        }
    }