Package org.bladerunnerjs.model

Examples of org.bladerunnerjs.model.App.dir()


      NameValidator.assertValidDirectoryName(app);
      requirePrefix = (requirePrefix == null) ? NameValidator.generateRequirePrefixFromApp(app) : requirePrefix;
     
      app.populate(requirePrefix);
      logger.println(Messages.APP_CREATED_CONSOLE_MSG, appName);
      logger.println(" " + app.dir().getPath());
     
      app.deploy();
      logger.println(Messages.APP_DEPLOYED_CONSOLE_MSG, appName);
    }
    catch(InvalidNameException e) {
View Full Code Here


    }
    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

  }

  public File getCompiledClassDir(BRJS brjs, File testDir) throws IOException
  {
    App app = brjs.locateAncestorNodeOfClass(testDir, App.class);
    String relativePath = RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), testDir);
   
    return new File(getClassesRoot(testDir), relativePath + "/test-integration/webdriver/tests");
  }
 
  public String getTestClassName(File testFile)
View Full Code Here

          String relativeFilePath = contentPath.properties.get(FILE_PATH_REQUEST_FORM);
         
          File unbundledResourcesDir = bundleSet.getBundlableNode().file(UNBUNDLED_RESOURCES_DIRNAME);
          App app = bundleSet.getBundlableNode().app();
          File requestedFile = new File(unbundledResourcesDir, relativeFilePath);
          String requestedFilePathRelativeToApp = RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), requestedFile);
         
          if (!requestedFile.isFile())
          {
            String requestedFilePathRelativeToRoot = RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir().getParentFile(), requestedFile);
            throw new ContentProcessingException("The requested unbundled resource at '"+requestedFilePathRelativeToRoot+"' does not exist or is not a file.");
View Full Code Here

          File requestedFile = new File(unbundledResourcesDir, relativeFilePath);
          String requestedFilePathRelativeToApp = RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), requestedFile);
         
          if (!requestedFile.isFile())
          {
            String requestedFilePathRelativeToRoot = RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir().getParentFile(), requestedFile);
            throw new ContentProcessingException("The requested unbundled resource at '"+requestedFilePathRelativeToRoot+"' does not exist or is not a file.");
          }
       
          ByteArrayOutputStream outputBuffer = new ByteArrayOutputStream();
          contentAccessor.handleRequest(requestedFilePathRelativeToApp, outputBuffer);
View Full Code Here

      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)
View Full Code Here

      if (warExport && warExportFile.exists()) {
        boolean deleted = FileUtils.deleteQuietly(warExportFile);
        if (!deleted) {
          File oldWarExportFile = warExportFile;
          warExportFile = new File(targetDir, appName+"_"+getBuiltAppTimestamp()+".war");
          brjs.logger(this.getClass()).warn( Messages.UNABLE_TO_DELETE_BULIT_APP_EXCEPTION, RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), oldWarExportFile), RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), warExportFile));
        }
      } else if (!warExport && appExportDir.exists()){
        boolean deleted = FileUtils.deleteQuietly(appExportDir);     
        if (!deleted) {
          File oldAppExportDir = appExportDir;
View Full Code Here

      if (warExport && warExportFile.exists()) {
        boolean deleted = FileUtils.deleteQuietly(warExportFile);
        if (!deleted) {
          File oldWarExportFile = warExportFile;
          warExportFile = new File(targetDir, appName+"_"+getBuiltAppTimestamp()+".war");
          brjs.logger(this.getClass()).warn( Messages.UNABLE_TO_DELETE_BULIT_APP_EXCEPTION, RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), oldWarExportFile), RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), warExportFile));
        }
      } else if (!warExport && appExportDir.exists()){
        boolean deleted = FileUtils.deleteQuietly(appExportDir);     
        if (!deleted) {
          File oldAppExportDir = appExportDir;
View Full Code Here

      } else if (!warExport && appExportDir.exists()){
        boolean deleted = FileUtils.deleteQuietly(appExportDir);     
        if (!deleted) {
          File oldAppExportDir = appExportDir;
          appExportDir = new File(targetDir, appName+"_"+getBuiltAppTimestamp());
          brjs.logger(this.getClass()).warn( Messages.UNABLE_TO_DELETE_BULIT_APP_EXCEPTION, RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), oldAppExportDir), RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), appExportDir));
        }
      }
      targetDir.mkdirs();
    }
   
View Full Code Here

      } else if (!warExport && appExportDir.exists()){
        boolean deleted = FileUtils.deleteQuietly(appExportDir);     
        if (!deleted) {
          File oldAppExportDir = appExportDir;
          appExportDir = new File(targetDir, appName+"_"+getBuiltAppTimestamp());
          brjs.logger(this.getClass()).warn( Messages.UNABLE_TO_DELETE_BULIT_APP_EXCEPTION, RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), oldAppExportDir), RelativePathUtility.get(brjs.getFileInfoAccessor(), app.dir(), appExportDir));
        }
      }
      targetDir.mkdirs();
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.