/** * Gets the Folders where to place the program-groups and their shortcuts, for the given usertype. * * @see com.izforge.izpack.util.os.Shortcut#getProgramsFolder(int) */ public String getProgramsFolder(int current_user) { /** CURRENT_USER = 0; the constant to use for selecting the current user. */ int USER = 0; if (current_user == Shortcut.CURRENT_USER) USER = ShellLink.CURRENT_USER; else if (current_user == Shortcut.ALL_USERS) USER = ShellLink.ALL_USERS; String result = null; try { result = new String( shortcut.getLinkPath(USER).getBytes(StringTool.getPlatformEncoding()), StringTool.getPlatformEncoding()); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } Debug.log(CLASS + myClass + ".getProgramsFolder() '" + current_user + "', '" + result + "'"); return result; }
/** * Gets the Folders where to place the program-groups and their shortcuts, for the given usertype. * * @see com.izforge.izpack.util.os.Shortcut#getProgramsFolder(int) */ @Override public String getProgramsFolder(int current_user) { /** CURRENT_USER = 0; the constant to use for selecting the current user. */ int USER = 0; if (current_user == Shortcut.CURRENT_USER) { USER = ShellLink.CURRENT_USER; } else if (current_user == Shortcut.ALL_USERS) { USER = ShellLink.ALL_USERS; } String result = null; try { result = new String( shortcut.getLinkPath(USER).getBytes(StringTool.getPlatformEncoding()), StringTool.getPlatformEncoding()); } catch (UnsupportedEncodingException e) { logger.log(Level.WARNING, e.getMessage(), e); } return result; }