com.facetmap.servlet
Class InputFactory

java.lang.Object
  extended by com.facetmap.servlet.InputFactory

public class InputFactory
extends java.lang.Object

Finds a valid InputStream for a named source, by searching different possible locations in classpath and on filesystem. More easily writeable locations take precedence, since they are more likely to be current.

These locations are searched, in this order:

  • servlet-context-relative filepath on disk
  • absolute filepath on disk
  • web application resource (i.e. ServletContext.getResource)
  • classpath resource (i.e. ClassLoader.getResource)

  • Field Summary
    protected  ServletContext servletContext
               
     
    Constructor Summary
    InputFactory(ServletContext servletContext)
               
     
    Method Summary
     java.io.InputStream getInputStream(java.lang.String inputName)
               
     ServletContext getServletContext()
               
     void setServletContext(ServletContext servletContext)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    servletContext

    protected ServletContext servletContext
    Constructor Detail

    InputFactory

    public InputFactory(ServletContext servletContext)
    Method Detail

    getInputStream

    public java.io.InputStream getInputStream(java.lang.String inputName)

    getServletContext

    public ServletContext getServletContext()

    setServletContext

    public void setServletContext(ServletContext servletContext)