org.apache.wicket.core.util.file
Class WebApplicationPath

java.lang.Object
  extended by org.apache.wicket.util.file.Path
      extended by org.apache.wicket.core.util.file.WebApplicationPath
All Implemented Interfaces:
IResourceFinder, IResourcePath

public final class WebApplicationPath
extends Path

Maintain a list of paths which might either be ordinary folders of the filesystem or relative paths to the web application's servlet context.

Author:
Johan Compagner

Constructor Summary
WebApplicationPath(javax.servlet.ServletContext servletContext)
          Constructor
 
Method Summary
 void add(String path)
           
 IResourceStream find(Class<?> clazz, String pathname)
          Looks for a given pathname along this path
 List<String> getWebappPaths()
           
 String toString()
           
 
Methods inherited from class org.apache.wicket.util.file.Path
add, getFolders, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebApplicationPath

public WebApplicationPath(javax.servlet.ServletContext servletContext)
Constructor

Parameters:
servletContext - The webapplication context where the resources must be loaded from
Method Detail

add

public void add(String path)
Specified by:
add in interface IResourcePath
Overrides:
add in class Path
Parameters:
path - add a path that is lookup through the servlet context
See Also:
IResourcePath.add(java.lang.String)

find

public IResourceStream find(Class<?> clazz,
                            String pathname)
Description copied from interface: IResourceFinder
Looks for a given pathname along this path

Specified by:
find in interface IResourceFinder
Overrides:
find in class Path
Parameters:
clazz - The class requesting the resource stream
pathname - The filename with possible path
Returns:
The resource stream
See Also:
IResourceFinder.find(Class, String)

getWebappPaths

public List<String> getWebappPaths()

toString

public String toString()
Overrides:
toString in class Path
See Also:
Object.toString()


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.