| | |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | | |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | |
| | | import org.opends.quicksetup.UserDataException; |
| | | |
| | | import java.util.logging.Logger; |
| | |
| | | LOG.log(Level.INFO, "obtaining file information interactively"); |
| | | while(true) { |
| | | String fileName = promptForString( |
| | | getMsg("upgrade-file-prompt"), null); |
| | | INFO_UPGRADE_FILE_PROMPT.get(), null); |
| | | try { |
| | | uud.setInstallPackage(validateInstallPackFile(fileName)); |
| | | LOG.log(Level.INFO, "file specified interactively: " + |
| | |
| | | } |
| | | } else { |
| | | throw new UserDataException(null, |
| | | getMsg("error-option-required-or-interactive", |
| | | "-" + UpgradeLauncher.FILE_OPTION_SHORT + "/--" + |
| | | INFO_ERROR_OPTION_REQUIRED_OR_INTERACTIVE.get("-" + |
| | | UpgradeLauncher.FILE_OPTION_SHORT + "/--" + |
| | | UpgradeLauncher.FILE_OPTION_LONG)); |
| | | } |
| | | return uud; |
| | |
| | | File f = new File(fileName); |
| | | if (!f.exists()) { |
| | | throw new UserDataException(null, |
| | | getMsg("build-extractor-error-file-no-exist", |
| | | fileName)); |
| | | INFO_BUILD_EXTRACTOR_ERROR_FILE_NO_EXIST.get(fileName)); |
| | | } else if (f.isDirectory() || !f.getName().toLowerCase().endsWith(".zip")) { |
| | | throw new UserDataException(null, |
| | | getMsg("build-extractor-error-file-not-zip", fileName)); |
| | | INFO_BUILD_EXTRACTOR_ERROR_FILE_NOT_ZIP.get(fileName)); |
| | | } |
| | | return f; |
| | | } |