*/
package org.apache.catalina;
+import java.util.regex.Pattern;
+
/**
* A <b>Host</b> is a Container that represents a virtual host in the
/**
+ * Return the compiled regular expression that defines the files and
+ * directories in the host's {@link #appBase} that will be ignored by the
+ * automatic deployment process.
+ */
+ public Pattern getDeployIgnorePattern();
+
+
+ /**
* Set the regular expression that defines the files and directories in
* the host's {@link #appBase} that will be ignored by the automatic
* deployment process.
import java.util.Locale;
import java.util.Map;
import java.util.WeakHashMap;
+import java.util.regex.Pattern;
import org.apache.catalina.Container;
import org.apache.catalina.Context;
* be ignored by the automatic deployment process (both
* {@link #deployOnStartup} and {@link #autoDeploy}).
*/
- private String deployIgnore = null;
+ private Pattern deployIgnore = null;
// ------------------------------------------------------------- Properties
*/
@Override
public String getDeployIgnore() {
+ if (deployIgnore == null) {
+ return null;
+ }
+ return this.deployIgnore.toString();
+ }
+
+
+ /**
+ * Return the compiled regular expression that defines the files and
+ * directories in the host's {@link #appBase} that will be ignored by the
+ * automatic deployment process.
+ */
+ @Override
+ public Pattern getDeployIgnorePattern() {
return this.deployIgnore;
}
*/
@Override
public void setDeployIgnore(String deployIgnore) {
- String oldDeployIgnore = this.deployIgnore;
- this.deployIgnore = deployIgnore;
+ String oldDeployIgnore;
+ if (this.deployIgnore == null) {
+ oldDeployIgnore = null;
+ } else {
+ oldDeployIgnore = this.deployIgnore.toString();
+ }
+ if (deployIgnore == null) {
+ this.deployIgnore = null;
+ } else {
+ this.deployIgnore = Pattern.compile(deployIgnore);
+ }
support.firePropertyChange("deployIgnore",
oldDeployIgnore,
- this.deployIgnore);
+ deployIgnore);
}
return unfilteredAppPaths;
}
- Pattern filter = Pattern.compile(host.getDeployIgnore());
+ Pattern filter = host.getDeployIgnorePattern();
List<String> filteredList = new ArrayList<String>();
for (String appPath : unfilteredAppPaths) {
if (filter.matcher(appPath).matches()) {
- log.debug(sm.getString("hostConfig.ignorePath", appPath));
+ if (log.isDebugEnabled()) {
+ log.debug(sm.getString("hostConfig.ignorePath", appPath));
+ }
} else {
filteredList.add(appPath);
}