org.apache.lenya.cms.cocoon.acting
Class ResourceExistsAction

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.acting.AbstractAction
          extended by org.apache.cocoon.acting.ServiceableAction
              extended by org.apache.lenya.cms.cocoon.acting.ResourceExistsAction
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.thread.ThreadSafe, org.apache.cocoon.acting.Action

public class ResourceExistsAction
extends org.apache.cocoon.acting.ServiceableAction
implements org.apache.avalon.framework.thread.ThreadSafe

This action simply checks to see if a given resource exists. It checks whether the specified in the src attribute source exists or not. The action returns empty Map if it exists, null otherwise.

Instead of src attribute, source can be specified using parameter named 'url' (this is old syntax).

In order to differentiate between files and directories, the type can be specified using the parameter 'type' (<map:parameter name="type" value="file"/> or <map:parameter name="type" value="directory"/>). The parameter 'type' is optional.

Note: org.apache.cocoon.selection.ResourceExistsSelector should be preferred to this component, as the semantics of a Selector better match the supplied functionality.


Field Summary
 
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
 
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
 
Fields inherited from interface org.apache.cocoon.acting.Action
ROLE
 
Constructor Summary
ResourceExistsAction()
           
 
Method Summary
 java.util.Map act(org.apache.cocoon.environment.Redirector redirector, org.apache.cocoon.environment.SourceResolver resolver, java.util.Map objectModel, java.lang.String source, org.apache.avalon.framework.parameters.Parameters parameters)
           
 
Methods inherited from class org.apache.cocoon.acting.ServiceableAction
service
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceExistsAction

public ResourceExistsAction()
Method Detail

act

public java.util.Map act(org.apache.cocoon.environment.Redirector redirector,
                         org.apache.cocoon.environment.SourceResolver resolver,
                         java.util.Map objectModel,
                         java.lang.String source,
                         org.apache.avalon.framework.parameters.Parameters parameters)
                  throws java.lang.Exception
Specified by:
act in interface org.apache.cocoon.acting.Action
Throws:
java.lang.Exception


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.