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

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


      Result result = Results.fail("Error executing script.");
      Resource<?> currentResource = (Resource<?>) context.getUIContext().getInitialSelection().get();

      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


         }

         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

   }

   @Override
   public List<Resource<?>> resolveChildren(String path)
   {
      ResourcePathResolver resolver = new ResourcePathResolver(getResourceFactory(), this, path);
      return resolver.resolve();
   }
View Full Code Here

      else
      {
         Resource<?> selectedResource = currentResource;
         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

      else
      {
         Resource<?> selectedResource = currentResource;
         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

   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();
         if (resources.isEmpty())
         {
            return Results.fail(path + ": path could not be resolved");
         }
         for (Resource<?> resource : resources)
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();
         if (resources.isEmpty())
         {
            return Results.fail(path + ": path could not be resolved");
         }
         for (Resource<?> resource : resources)
View Full Code Here

      List<Resource<?>> resourceList;
      if (it.hasNext())
      {
         String value = it.next();
         boolean searching = (value.matches(".*(\\?|\\*)+.*"));
         resourceList = new ResourcePathResolver(resourceFactory, currentResource, value).resolve();
         if (!searching && !resourceList.isEmpty() && resourceList.get(0).exists())
         {
            resourceList = resourceList.get(0).listResources();
         }
      }
View Full Code Here

      Result result = Results.success();
      UIOutput output = shell.getOutput();
      while (it.hasNext())
      {
         final Resource<?> resource = it.hasNext() ?
                  (new ResourcePathResolver(resourceFactory, currentResource, it.next()).resolve().get(0)) : currentResource;

         if (!resource.exists())
         {
            output.err().println("cat: " + resource.getName() + ": No such file or directory");
            result = Results.fail();
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");
         }
         else
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.