org.apache.examples
Class ExampleUtils

java.lang.Object
  extended by org.apache.examples.ExampleUtils

public class ExampleUtils
extends java.lang.Object

Utilities needed by the examples.

Author:
Howard Lewis Ship

Constructor Summary
ExampleUtils()
           
 
Method Summary
static org.apache.hivemind.Registry buildClasspathRegistry(java.lang.String file)
          Convenience method for invoking buildClasspathRegistry(String[]) with only a single file.
static org.apache.hivemind.Registry buildClasspathRegistry(java.lang.String[] files)
          Builds a registry for files in the classpath.
protected static org.apache.hivemind.Registry buildRegistry(org.apache.hivemind.ModuleDescriptorProvider customProvider)
           
static org.apache.hivemind.Registry buildRegistry(java.lang.String fileName)
          Builds a Registry for a file stored in the src/descriptor/META-INF directory.
protected static org.apache.hivemind.Resource getResource(java.lang.String file)
          Returns the given file as a Resource from the classpath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExampleUtils

public ExampleUtils()
Method Detail

buildRegistry

public static org.apache.hivemind.Registry buildRegistry(java.lang.String fileName)
Builds a Registry for a file stored in the src/descriptor/META-INF directory.

Parameters:
fileName - -- the name of the module descriptor file.

buildClasspathRegistry

public static org.apache.hivemind.Registry buildClasspathRegistry(java.lang.String file)
                                                           throws java.lang.Exception
Convenience method for invoking buildClasspathRegistry(String[]) with only a single file.

Throws:
java.lang.Exception

buildClasspathRegistry

public static org.apache.hivemind.Registry buildClasspathRegistry(java.lang.String[] files)
                                                           throws java.lang.Exception
Builds a registry for files in the classpath.

Throws:
java.lang.Exception

buildRegistry

protected static org.apache.hivemind.Registry buildRegistry(org.apache.hivemind.ModuleDescriptorProvider customProvider)

getResource

protected static org.apache.hivemind.Resource getResource(java.lang.String file)
Returns the given file as a Resource from the classpath. Typically, this is to find files in the same folder as the invoking class.