org.apache.myfaces.test.mock.resource
Class MockSimpleResource

java.lang.Object
  extended by javax.faces.application.Resource
      extended by org.apache.myfaces.test.mock.resource.MockSimpleResource

public class MockSimpleResource
extends javax.faces.application.Resource

Mock simple implementation of Resource.

It is used by MockSimpleResourceHandler to wrap resource instances.

Since:
1.0.0
Version:
$Revision: 882702 $ $Date: 2009-11-20 15:16:07 -0500 (Vie, 20 Nov 2009) $
Author:
Jakob Korherr (latest modification by $Author: lu4242 $)

Field Summary
 
Fields inherited from class javax.faces.application.Resource
COMPONENT_RESOURCE_KEY
 
Constructor Summary
MockSimpleResource(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion, File documentRoot)
          Creates new resource object
 
Method Summary
 InputStream getInputStream()
           
 String getLibraryName()
           
 String getRequestPath()
           
 String getResourceName()
           
 Map<String,String> getResponseHeaders()
           
 URL getURL()
           
 void setLibraryName(String libraryName)
           
 void setResourceName(String resourceName)
           
 boolean userAgentNeedsUpdate(javax.faces.context.FacesContext context)
           
 
Methods inherited from class javax.faces.application.Resource
getContentType, setContentType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MockSimpleResource

public MockSimpleResource(String prefix,
                          String libraryName,
                          String libraryVersion,
                          String resourceName,
                          String resourceVersion,
                          File documentRoot)
Creates new resource object

Parameters:
prefix - locale prefix if any
libraryName - resource library name
libraryVersion - resource library version if any
resourceName - resource file name
resourceVersion - resource version if any
documentRoot - parent folder of resource directories. Must not be null
Method Detail

getResourceName

public String getResourceName()
Overrides:
getResourceName in class javax.faces.application.Resource

setResourceName

public void setResourceName(String resourceName)
Overrides:
setResourceName in class javax.faces.application.Resource

getLibraryName

public String getLibraryName()
Overrides:
getLibraryName in class javax.faces.application.Resource

setLibraryName

public void setLibraryName(String libraryName)
Overrides:
setLibraryName in class javax.faces.application.Resource

getInputStream

public InputStream getInputStream()
                           throws IOException
Specified by:
getInputStream in class javax.faces.application.Resource
Throws:
IOException

getRequestPath

public String getRequestPath()
Specified by:
getRequestPath in class javax.faces.application.Resource

getResponseHeaders

public Map<String,String> getResponseHeaders()
Specified by:
getResponseHeaders in class javax.faces.application.Resource

getURL

public URL getURL()
Specified by:
getURL in class javax.faces.application.Resource

userAgentNeedsUpdate

public boolean userAgentNeedsUpdate(javax.faces.context.FacesContext context)
Specified by:
userAgentNeedsUpdate in class javax.faces.application.Resource


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.