Package org.bladerunnerjs.model.exception.command

Examples of org.bladerunnerjs.model.exception.command.CommandArgumentsException


        try {
          createLibraryType = SupportedLibraryType.valueOf(libraryType);
          SupportedLibraryType.valueOf(libraryType);
        } catch (IllegalArgumentException ex) {
           String exceptionMsg = String.format(Messages.INVALID_LIB_TYPE_MESSAGE, libraryType, StringUtils.join(SupportedLibraryType.values(), ", ") );
           throw new CommandArgumentsException(exceptionMsg, this);
        }
   
    App app = brjs.app(appName);
    if(!app.dirExists()) throw new NodeDoesNotExistException(app, this);
   
    JsLib library = app.appJsLib(libraryName);
    if (library.dirExists()) throw new NodeAlreadyExistsException(library, this);
   
    switch ( createLibraryType ) {
      case br:
        break;
      case thirdparty:
        createThirdpartyManifest(library);
        break;
    }
   
    try {
      library.populate();
    }
    catch(InvalidNameException e) {
      throw new CommandArgumentsException(e, this);
    }
    catch(ModelUpdateException e) {
      throw new CommandOperationException("Cannot create library '" + library.dir().getPath() + "'", e);
    }
   
View Full Code Here


     
      appServer.join();
    }
    catch(NumberFormatException e)
    {
      throw new CommandArgumentsException(Messages.INVALID_PORT_MESSAGE + " '" + parsedArgs.getString("port") + "' ", e, this);
    }
   
    catch (IOException e)
    {
      throw new CommandOperationException(e);
View Full Code Here

     
      app.deploy();
      logger.println(Messages.APP_DEPLOYED_CONSOLE_MSG, appName);
    }
    catch(InvalidNameException e) {
      throw new CommandArgumentsException(e, this);
    }
    catch(ModelUpdateException | TemplateInstallationException e) {
      throw new CommandOperationException("Cannot create application '" + app.dir().getPath() + "'", e);
    }
    return 0;
View Full Code Here

    {
      return testRunner.run(args, this);
    }
    else
    {
      throw new CommandArgumentsException("Invalid arguments provided.", this);
    }
  }
View Full Code Here

    String newAppNamespace = parsedArgs.getString("new-app-require-prefix");
   
    File appZip = (new File(appZipName).exists()) ? new File(appZipName) : new File(brjs.file("sdk"), appZipName);
    App app = brjs.app(newAppName);
   
    if(!appZip.exists()) throw new CommandArgumentsException("Couldn't find zip file at '" + appZipName + "'.", this);
    if(app.dirExists()) throw new NodeAlreadyExistsException(app, this);
   
    try
    {
      NameValidator.assertValidDirectoryName(app);
      NameValidator.assertValidRootPackageName(app, newAppNamespace);
     
      NodeImporter.importAppFromZip(new ZipFile(appZip), app, newAppNamespace);
     
      app.deploy();
     
      logger.println("Successfully imported '" + new File(appZipName).getName() + "' as new application '" + newAppName + "'");
      logger.println(" " + app.dir().getAbsolutePath());
    }
    catch(InvalidDirectoryNameException | InvalidRootPackageNameException e) {
      throw new CommandArgumentsException("Failed to import application from zip '" + appZipName + "'.", e, this);
    }
    catch (Exception e)
    {
      throw new CommandOperationException("Failed to import application from zip '" + appZipName + "'.", e);
    }
View Full Code Here

   
    try {
      NameValidator.assertValidPackageName(targetApp, targetBladesetName);
    }
    catch (InvalidPackageNameException e) {
      throw new CommandArgumentsException(e, this);
    }
   
    Bladeset targetBladeset = targetApp.bladeset(targetBladesetName);
   
    if (!sourceApp.dirExists()) throw new NodeDoesNotExistException(sourceApp, this);
View Full Code Here

  @Override
  protected int doCommand(JSAPResult parsedArgs) throws CommandArgumentsException, CommandOperationException {
    String appName = parsedArgs.getString("app-name");
    App app = brjs.app(appName);
   
    if(!app.dirExists()) throw new CommandArgumentsException( String.format(Messages.APP_DOES_NOT_EXIST_EXCEPTION, appName), this );
   
    Map<String, String> transformations = new HashMap<>();
    transformations.put("app-name", app.getName());
    try
    {
View Full Code Here

   
    try {
      bladeset.populate();
    }
    catch(InvalidNameException e) {
      throw new CommandArgumentsException(e, this);
    }
    catch(ModelUpdateException e) {
      throw new CommandOperationException("Cannot create bladeset '" + bladeset.dir().getPath() + "'", e);
    }
   
View Full Code Here

  private void getHelpForSpecificCommand(String commandName) throws CommandArgumentsException
  {
    CommandPlugin command = brjs.plugins().commandPlugin(commandName);
   
    if(command == null) throw new CommandArgumentsException("Cannot show help, unknown command '" + commandName + "'", this);
   
    logger.println("Description:");
    logger.println("  " + command.getCommandDescription());
    logger.println("");
   
View Full Code Here

   
    try {
      blade.populate();
    }
    catch(InvalidNameException e) {
      throw new CommandArgumentsException(e, this);
    }
    catch(ModelUpdateException e) {
      throw new CommandOperationException("Cannot create blade '" + blade.dir().getPath() + "'", e);
    }
   
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.model.exception.command.CommandArgumentsException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.