Package org.jboss.forge.addon.resource.util

Examples of org.jboss.forge.addon.resource.util.ResourcePathResolver


   public Result execute(UIExecutionContext context) throws Exception
   {
      Resource<?> currentResource = (Resource<?>) context.getUIContext().getInitialSelection().get();
      for (String file : arguments.getValue())
      {
         List<Resource<?>> resources = new ResourcePathResolver(resourceFactory, currentResource, file).resolve();
         for (Resource<?> resource : resources)
         {
            if (!resource.exists())
            {
               return Results.fail(file + ": no such file or directory");
            }
         }
      }

      boolean forceOption = force.getValue();
      boolean recurse = recursive.getValue();
      UIPrompt prompt = context.getPrompt();
      UIOutput output = context.getUIContext().getProvider().getOutput();
      for (String file : arguments.getValue())
      {
         List<Resource<?>> resources = new ResourcePathResolver(resourceFactory, currentResource, file).resolve();
         for (Resource<?> resource : resources)
         {
            if ((resource instanceof DirectoryResource))
            {
               if (!recurse)
View Full Code Here


      }
      else
      {
         ALL: for (String path : arguments.getValue())
         {
            List<Resource<?>> resources = new ResourcePathResolver(resourceFactory, currentResource, path).resolve();
            for (Resource<?> resource : resources)
            {
               if (resource.exists())
               {
                  final PipedOutputStream stdin = new PipedOutputStream();
View Full Code Here

      Iterator<String> it = value == null ? Collections.<String> emptyIterator() : value.iterator();
      final Result result;
      if (it.hasNext())
      {
         String newPath = it.next();
         final List<Resource<?>> newResource = new ResourcePathResolver(resourceFactory, currentResource, newPath)
                  .resolve();
         if (newResource.isEmpty() || !newResource.get(0).exists())
         {
            result = Results.fail(newPath + ": No such file or directory");
         }
View Full Code Here

   public Result execute(UIExecutionContext context) throws Exception
   {
      Resource<?> currentResource = (Resource<?>) context.getUIContext().getInitialSelection().get();
      for (String path : arguments.getValue())
      {
         List<Resource<?>> resources = new ResourcePathResolver(resourceFactory, currentResource, path).resolve();
         for (Resource<?> resource : resources)
         {
            if (resource.exists())
            {
               return Results.fail(path + ": Resource already exists.");
View Full Code Here

         }

         if (newResource == null)
         {
            Resource<?> currentResource = (Resource<?>) uiContext.getInitialSelection().get();
            newResource = new ResourcePathResolver(resourceFactory, currentResource, token).resolve();
         }

         if (newResource.isEmpty() || !newResource.get(0).exists())
         {
            result = Results.fail(token + ": No such file or directory");
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.resource.util.ResourcePathResolver

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.