de.smartics.exceptions.report.utils
Class JavadocUtils

Package class diagram package JavadocUtils
java.lang.Object
  extended by de.smartics.exceptions.report.utils.JavadocUtils

public final class JavadocUtils
     
     
extends Object

Provides functions for manipulating Javadoc related information.


Method Summary
static String constructRelativePath(String dirPath1, String dirPath2)
          Constructs a relative path between the two directories.
static String expandJavadocUrl(String javadocRoot, String className)
          Creates the URL to a Javadoc document for the given class.
static String[] split(String dirPath)
          Splits the given path in an array containing the names of the files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

expandJavadocUrl

public static String expandJavadocUrl(String javadocRoot,
                                      String className)
                               throws NullPointerException,
                                      IllegalArgumentException
Creates the URL to a Javadoc document for the given class.

Parameters:
javadocRoot - the root directory of the Javadoc documentation. This should be a relative URL but it may also be absolute (the method does not bother). If this value is the empty string, not path delimiter ( /) will be prepended. The method replaces all occurrences of \ with /.
className - the fully qualified name of the class the URL should point to.
Returns:
the URL that points to the documentation for the specified class in the specified Javadoc root directory.
Throws:
NullPointerException - if any of the arguments is null.
IllegalArgumentException - if the name of the class is the empty string.

constructRelativePath

public static String constructRelativePath(String dirPath1,
                                           String dirPath2)
                                    throws NullPointerException,
                                           IllegalArgumentException
Constructs a relative path between the two directories.

The method assumes that both paths are directories. If at least one of the paths is a file, the result is incorrect. The method has no bullet-proof means to check if the path is directing to a file or not since the file is not required to exist.

Parameters:
dirPath1 - the path to one directory.
dirPath2 - the path to another directory.
Returns:
a relative path from directory 2 to directory 1.
Throws:
NullPointerException - if any of the arguments is null.
IllegalArgumentException - if any of the paths is the empty string.

split

public static String[] split(String dirPath)
Splits the given path in an array containing the names of the files.

If a null value is provided for the path argument, the empty array is returned.

Parameters:
dirPath - the path to split.
Returns:
an array containing the directory names of the path.


Copyright © 2007-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.