org.apache.maven.doxia.site.decoration.inheritance
Class PathDescriptor

java.lang.Object
  extended by org.apache.maven.doxia.site.decoration.inheritance.PathDescriptor

public class PathDescriptor
extends java.lang.Object

This class holds an instance of a maven path. This consists of a relative path (e.g. images/maven-logo.png) and a base reference which can also be a relative path (e.g. '.' or '../doxia') or an URL that is used for an absolute anchor.

Version:
$Id: PathDescriptor.java 542490 2007-05-29 11:18:51Z vsiveton $
Author:
Henning P. Schmiedehausen

Field Summary
private  java.net.URL baseUrl
           
private  java.net.URL pathUrl
           
private  java.lang.String relativePath
           
 
Constructor Summary
PathDescriptor(java.lang.String path)
           
PathDescriptor(java.lang.String base, java.lang.String path)
           
PathDescriptor(java.net.URL baseUrl, java.lang.String path)
           
 
Method Summary
private static java.net.URL buildBaseUrl(java.lang.String base)
           
private static java.net.URL buildUrl(java.net.URL baseUrl, java.lang.String path)
           
 java.net.URL getBaseUrl()
           
 java.lang.String getLocation()
           
 java.lang.String getPath()
           
 java.net.URL getPathUrl()
           
 boolean isFile()
           
 boolean isRelative()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

baseUrl

private final java.net.URL baseUrl

pathUrl

private final java.net.URL pathUrl

relativePath

private final java.lang.String relativePath
Constructor Detail

PathDescriptor

public PathDescriptor(java.lang.String path)
               throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

PathDescriptor

public PathDescriptor(java.lang.String base,
                      java.lang.String path)
               throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

PathDescriptor

public PathDescriptor(java.net.URL baseUrl,
                      java.lang.String path)
               throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException
Method Detail

buildBaseUrl

private static final java.net.URL buildBaseUrl(java.lang.String base)
                                        throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

buildUrl

private static final java.net.URL buildUrl(java.net.URL baseUrl,
                                           java.lang.String path)
                                    throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

isFile

public boolean isFile()

isRelative

public boolean isRelative()

getBaseUrl

public java.net.URL getBaseUrl()

getPathUrl

public java.net.URL getPathUrl()

getPath

public java.lang.String getPath()

getLocation

public java.lang.String getLocation()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object