1 package org.apache.turbine.pipeline; 2 3 56 57 import org.apache.turbine.RunData; 58 59 import org.apache.commons.logging.Log; 60 import org.apache.commons.logging.LogFactory; 61 62 69 public class TargetExtensionConditionalValve 70 extends ConditionalValve 71 { 72 private static final Log log 73 = LogFactory.getLog( TargetExtensionConditionalValve.class ); 74 75 76 private String extension; 77 78 protected boolean shouldInvoke( RunData data ) 79 { 80 String target = data.getTarget(); 81 82 return ( target != null ) && ( target.endsWith( extension ) ); 83 } 84 85 88 public void setExtension( String extension ) 89 { 90 if ( extension.startsWith( "." ) ) 91 { 92 this.extension = extension; 93 } 94 else 95 { 96 this.extension = "." + extension; 97 } 98 99 log.debug( "Extension set to " + extension ); 100 } 101 } 102 | Popular Tags |