Package org.jboss.forge.addon.resource

Examples of org.jboss.forge.addon.resource.DirectoryResource


      }
      else
      {
         resFolderName = "src" + File.separator + "test" + File.separator + "resources";
      }
      DirectoryResource projectRoot = getFaceted().getRootDirectory();
      return projectRoot.getChildDirectory(resFolderName);
   }
View Full Code Here


      }
      else
      {
         webappFolderName = "src" + File.separator + "main" + File.separator + "webapp";
      }
      DirectoryResource projectRoot = project.getRootDirectory();
      return projectRoot.getChildDirectory(webappFolderName);
   }
View Full Code Here

      }
      else
      {
         srcFolderName = "src" + File.separator + "main" + File.separator + "java";
      }
      DirectoryResource projectRoot = getFaceted().getRootDirectory();
      return projectRoot.getChildDirectory(srcFolderName);
   }
View Full Code Here

      }
      else
      {
         srcFolderName = "src" + File.separator + "test" + File.separator + "java";
      }
      DirectoryResource projectRoot = getFaceted().getRootDirectory();
      return projectRoot.getChildDirectory(srcFolderName);
   }
View Full Code Here

   }

   private Project createSubmoduleProject(final Project parent, String moduleName, String artifactId,
            Class<? extends ProjectFacet>... requiredProjectFacets)
   {
      DirectoryResource location = parent.getRoot().reify(DirectoryResource.class)
               .getOrCreateChildDirectory(moduleName);

      List<Class<? extends ProjectFacet>> facets = new ArrayList<>();
      facets.add(ResourcesFacet.class);
      facets.addAll(Arrays.asList(requiredProjectFacets));
View Full Code Here

         list.addAll(Arrays.asList(arguments));
      }
      String[] params = list.toArray(new String[list.size()]);
      try
      {
         DirectoryResource directory = getFaceted().getRoot().reify(DirectoryResource.class);
         if (directory == null)
            throw new IllegalStateException("Cannot execute maven build on resources that are not File-based.");
         int returnValue = NativeSystemCall.execFromPath(getMvnCommand(), params, out, directory);
         if (returnValue == 0)
            return true;
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      // TODO: Option to save sources?
      File tempDir = OperatingSystemUtils.createTempDir();
      DirectoryResource projectRoot = resourceFactory.create(DirectoryResource.class, tempDir);
      UIProgressMonitor progressMonitor = context.getProgressMonitor();
      UIOutput output = context.getUIContext().getProvider().getOutput();
      progressMonitor.beginTask("Installing Addon from Git", 4);

      progressMonitor.subTask("Cloning repository in " + tempDir);

      // Clone repository
      cloneTo(projectRoot);

      progressMonitor.worked(1);
      progressMonitor.subTask("Installing project into local repository");
      // Build project
      Project project = projectFactory.findProject(projectRoot);
      if (project == null)
      {
         return Results.fail("No project found in root " + projectRoot.getFullyQualifiedName());
      }
      Coordinate buildCoordinate = project.getFacet(MetadataFacet.class).getOutputDependency().getCoordinate();
      try
      {
         updateFurnaceVersion(project);
View Full Code Here

   }

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      DirectoryResource cloneFolder = targetDirectory.getValue();
      if (!cloneFolder.exists())
      {
         cloneFolder.mkdirs();
      }
      Git clone = gitUtils.clone(cloneFolder, uri.getValue());
      gitUtils.close(clone);
      context.getUIContext().setSelection(cloneFolder);
      return Results.success();
View Full Code Here

   }

   @Override
   public void validate(UIValidationContext validator)
   {
      DirectoryResource folder = targetDirectory.getValue();
      if (folder.exists() && (!folder.isDirectory() || !folder.listResources().isEmpty()))
      {
         validator.addValidationError(targetDirectory, "The specified target directory should not exist or should be empty directory");
      }
   }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      Result result = Results.success("Project named '" + named.getValue() + "' has been created.");
      DirectoryResource directory = targetLocation.getValue();
      DirectoryResource targetDir = directory.getChildDirectory(named.getValue());

      if (targetDir.mkdirs() || overwrite.getValue())
      {
         ProjectType value = type.getValue();

         Project project = null;
         if (value != null)
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.resource.DirectoryResource

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.