Forge - Parent 1.2.3-SNAPSHOT

org.jboss.forge.shell.util
Class ResourceUtil

java.lang.Object
  extended by org.jboss.forge.shell.util.ResourceUtil

public class ResourceUtil
extends Object

A set of utilities to work with the resources API.

Author:
Mike Brock, Lincoln Baxter, III

Constructor Summary
ResourceUtil()
           
 
Method Summary
static
<E extends Resource<?>,R extends Collection<E>>
R
filter(ResourceFilter filter, Collection<E> list)
           
static
<E extends Resource<?>,R extends Collection<E>,I extends Collection<Resource<?>>>
R
filterByType(Class<E> type, I list)
           
static DirectoryResource getContextDirectory(Resource<?> r)
           
static File getContextFile(Resource<?> r)
          A simple utility method to locate the outermost contextual File reference for the specified resource.
static boolean isChildOf(Resource<?> parent, Resource<?> isChild)
           
static List<Resource<?>> parsePathspec(ResourceFactory factory, Resource<?> resource, String pathspec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceUtil

public ResourceUtil()
Method Detail

getContextFile

public static File getContextFile(Resource<?> r)
A simple utility method to locate the outermost contextual File reference for the specified resource.

Parameters:
r - resource instance.
Returns:
outermost relevant file context.

getContextDirectory

public static DirectoryResource getContextDirectory(Resource<?> r)

parsePathspec

public static List<Resource<?>> parsePathspec(ResourceFactory factory,
                                              Resource<?> resource,
                                              String pathspec)

isChildOf

public static boolean isChildOf(Resource<?> parent,
                                Resource<?> isChild)

filter

public static <E extends Resource<?>,R extends Collection<E>> R filter(ResourceFilter filter,
                                                                       Collection<E> list)

filterByType

public static <E extends Resource<?>,R extends Collection<E>,I extends Collection<Resource<?>>> R filterByType(Class<E> type,
                                                                                                               I list)

Forge - Parent 1.2.3-SNAPSHOT

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.