/** * @param message The message to be displayed or <code>null</code> to display a Password prompt * @param link the {@link CryptedLink} * @return the entered password * @throws DecrypterException if the user aborts the input */ public static String getUserInput(final String message, final CryptedLink link) throws DecrypterException { final String password = PluginUtils.askPassword(message, link); if (password == null) { throw new DecrypterException(DecrypterException.PASSWORD); } return password; }
/** * @param message The message to be displayed or <code>null</code> to display a Password prompt * @param link the {@link DownloadLink} * @return the entered password * @throws PluginException if the user aborts the input */ public static String getUserInput(final String message, final DownloadLink link) throws PluginException { final String password = PluginUtils.askPassword(message, link); if (password == null) { throw new PluginException( LinkStatus.ERROR_FATAL, JDL.L("plugins.errors.wrongpassword", "Password wrong")); } return password; }