org.codehaus.plexus.summit.resolver
Class ResolverUtils

java.lang.Object
  extended byorg.codehaus.plexus.summit.resolver.ResolverUtils

public class ResolverUtils
extends java.lang.Object

A set of utilities that help with fulling resolving a target view.

Version:
$Id: ResolverUtils.java 2083 2005-06-05 03:01:09Z jvanzyl $
Author:
Jason van Zyl

Constructor Summary
ResolverUtils()
           
 
Method Summary
static java.util.List getPossibleViews(java.lang.String target, java.lang.String defaultTarget)
          Get the parsed module name for the specified template.
static int parseTargetPath(java.lang.String target, java.lang.StringBuffer buffer)
          Parse the template name collected from URL parameters or template context to a path name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResolverUtils

public ResolverUtils()
Method Detail

getPossibleViews

public static java.util.List getPossibleViews(java.lang.String target,
                                              java.lang.String defaultTarget)
                                       throws java.lang.Exception
Get the parsed module name for the specified template.

Parameters:
target - The target name.
defaultTarget - The target to view in the current directory if the specified target doesn't exist.
Returns:
The possible views.
Throws:
java.lang.Exception - a generaic exception.

parseTargetPath

public static int parseTargetPath(java.lang.String target,
                                  java.lang.StringBuffer buffer)
                           throws java.lang.Exception
Parse the template name collected from URL parameters or template context to a path name. Double slashes are changed into single ones and commas used as path delemiters in URL parameters are changed into slashes. Empty names or names without a file part are not accepted. NOTE: this particular method is public so that it can be tested.

Parameters:
target - The template name.
buffer - A buffer for the result.
Returns:
The index of the separator between the path and the name.
Throws:
java.lang.Exception - Malformed template name.


Copyright © 2001-2007 Codehaus. All Rights Reserved.