/** */ @Override protected int executeCommand() throws CommandException, CommandValidationException { throw new CommandException("Not implemented"); } }
/** * Make sure the command name is legitimate and * won't allow any URL spoofing attacks. */ private void checkName() throws CommandException { if (!name.matches(COMMAND_NAME_REGEXP)) { throw new CommandException("Illegal command name: " + name); //todo: XXX - I18N } }
/** * Make sure the command name is legitimate and * won't allow any URL spoofing attacks. */ private void checkName() throws CommandException { if (!name.matches(COMMAND_NAME_REGEXP)) { throw new CommandException("Illegal command name: " + name); //todo: XXX - I18N } }
/** * Make sure the command name is legitimate and * won't allow any URL spoofing attacks. */ private void checkName() throws CommandException { if (!name.matches(COMMAND_NAME_REGEXP)) throw new CommandException("Illegal command name: " + name); // XXX - I18N }
/** * Check for existence of key file. * @param file * @throws CommandException */ void validateKey(String file) throws CommandException { File f = new File(file); if (!f.exists()) { throw new CommandException(Strings.get("KeyDoesNotExist", file)); } } }
@Override protected void validate() throws CommandException, CommandValidationException { if (localOnly && remoteOnly) { throw new CommandException(strings.get("listCommands.notBoth")); } }
@Override protected void validate() throws CommandException, CommandValidationException { if (localOnly && remoteOnly) { throw new CommandException(strings.get("listCommands.notBoth")); } }
/** * If this is an unsupported command, throw an exception. */ private static void checkUnsupportedLegacyCommand(String cmd) throws CommandException { for (String c : unsupported) { if (c.equals(cmd)) { throw new CommandException( strings.get("UnsupportedLegacyCommand", cmd)); } } // it is a supported command; do nothing }
private void writeProperties() throws CommandException { String filename = ""; try { filename = dasPropsFile.getName(); if (!dasPropsFile.isFile()) { writeDasProperties(); } } catch (IOException ex) { throw new CommandException(Strings.get("Instance.cantWriteProperties", filename), ex); } }
private void validateAsadmin() throws CommandException { String s = SystemPropertyConstants.getAsAdminScriptLocation(); if (!ok(s)) throw new CommandException( strings.get("internal.error", "Can't get Asadmin script location")); asadminScript = SmartFile.sanitize(new File(s)); if (!asadminScript.isFile()) { throw new CommandException( strings.get("create.service.noAsadminScript", asadminScript)); } }
private void validateAsadmin() throws CommandException { String s = SystemPropertyConstants.getAsAdminScriptLocation(); if (!ok(s)) throw new CommandException( strings.get("internal.error", "Can't get Asadmin script location")); asadminScript = SmartFile.sanitize(new File(s)); if (!asadminScript.isFile()) { throw new CommandException( strings.get("create.service.noAsadminScript", asadminScript)); } }
private void validateServiceName() throws CommandException { if (!ok(serviceName)) serviceName = dirs.getServerDir().getName(); // On Windows we need a legal filename for the service name. if(OS.isWindowsForSure() && !FileUtils.isFriendlyFilename(serviceName)) { throw new CommandException(strings.get("create.service.badServiceName", serviceName)); } if (logger.isLoggable(Level.FINER)) logger.finer("service name = " + serviceName); }
/** */ @Override final protected int executeCommand() throws CommandException { if (isRunning()) { throw new CommandException(Strings.get("DeleteInstance.running")); } whackFilesystem(); return SUCCESS; } }
private void validateServiceName() throws CommandException { if (!ok(serviceName)) serviceName = dirs.getServerDir().getName(); // On Windows we need a legal filename for the service name. if(OS.isWindowsForSure() && !FileUtils.isFriendlyFilename(serviceName)) { throw new CommandException(strings.get("create.service.badServiceName", serviceName)); } logger.finer("service name = " + serviceName); }
private void validateServiceName() throws CommandException { if (!ok(serviceName)) serviceName = dirs.getServerDir().getName(); // On Windows we need a legal filename for the service name. if(OS.isWindowsForSure() && !FileUtils.isFriendlyFilename(serviceName)) { throw new CommandException(strings.get("create.service.badServiceName", serviceName)); } logger.finer("service name = " + serviceName); }
@Override protected void validate() throws CommandException { super.validate(); File dir = getServerDirs().getServerDir(); if(!dir.isDirectory()) throw new CommandException(Strings.get("Instance.noSuchInstance")); }
private void validateServiceName() throws CommandException { if (!ok(serviceName)) serviceName = dirs.getServerDir().getName(); // On Windows we need a legal filename for the service name. if(OS.isWindowsForSure() && !FileUtils.isFriendlyFilename(serviceName)) { throw new CommandException(strings.get("create.service.badServiceName", serviceName)); } logger.finer("service name = " + serviceName); }
protected void initDomain() throws CommandException { try { File domainsDirFile = null; if (ok(domainDirParam)) domainsDirFile = new File(domainDirParam); dd = new DomainDirs(domainsDirFile, getDomainName()); setServerDirs(dd.getServerDirs()); } catch (Exception e) { throw new CommandException(e.getMessage(), e); } setLocalPassword(); }
private Reader getSource() throws CommandException, CommandValidationException { CLICommand cmd = CLICommand.getCommand(habitat, getCommandName()); Reader r = cmd.getManPage(); if (r == null) throw new CommandException( strings.get("ManpageMissing", getCommandName())); return r; }
private Reader getSource() throws CommandException, CommandValidationException { CLICommand cmd = CLICommand.getCommand(habitat, getCommandName()); Reader r = cmd.getManPage(); if (r == null) throw new CommandException( strings.get("ManpageMissing", getCommandName())); return expandManPage(r); }