You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by tb...@apache.org on 2004/04/16 21:55:11 UTC
cvs commit: avalon/merlin/composition/api/src/java/org/apache/avalon/composition/data ExcludeDirective.java FilesetDirective.java
tbennett 2004/04/16 12:55:11
Modified: merlin/composition/api/src/java/org/apache/avalon/composition/data
FilesetDirective.java
Added: merlin/composition/api/src/java/org/apache/avalon/composition/data
ExcludeDirective.java
Log:
Adds an exclude directive to the classloader/classpath fileset directive and provides a getter method in the FilesetDirective to obtain the list of excluded file(s)
Revision Changes Path
1.4 +32 -2 avalon/merlin/composition/api/src/java/org/apache/avalon/composition/data/FilesetDirective.java
Index: FilesetDirective.java
===================================================================
RCS file: /home/cvs/avalon/merlin/composition/api/src/java/org/apache/avalon/composition/data/FilesetDirective.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FilesetDirective.java 24 Feb 2004 22:18:21 -0000 1.3
+++ FilesetDirective.java 16 Apr 2004 19:55:11 -0000 1.4
@@ -22,17 +22,19 @@
/**
* <p>A fileset directive is a scoped defintion of a set of files. A fileset
* a structurally defined as a base directory and a set of relative filenames
- * represented as include directives.</p>
+ * represented as include directives and/or exclude directives.</p>
*
* <p><b>XML</b></p>
* <pre>
* <fileset dir="<font color="darkred">lib</font>">
* <include name="<font color="darkred">avalon-framework.jar</font>"/>
* <include name="<font color="darkred">logkit.jar</font>"/>
+ * <exclude name="<font color="darkred">servlet.jar</font>"/>
* </dirset>
* </pre>
*
* @see IncludeDirective
+ * @see ExcludeDirective
* @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
* @version $Revision$ $Date$
*/
@@ -49,6 +51,11 @@
private final IncludeDirective[] m_includes;
/**
+ * The set of exclude directives.
+ */
+ private final ExcludeDirective[] m_excludes;
+
+ /**
* Create a FilesetDirective instance.
*
* @param base the base directory path against which includes are evaluated
@@ -56,8 +63,21 @@
*/
public FilesetDirective( final String base, final IncludeDirective[] includes )
{
+ this(base, includes, null);
+ }
+
+ /**
+ * Create a FilesetDirective instance.
+ *
+ * @param base the base directory path against which includes are evaluated
+ * @param includes the set of includes to include in the fileset
+ */
+ public FilesetDirective( final String base, final IncludeDirective[] includes,
+ final ExcludeDirective[] excludes)
+ {
m_base = base;
m_includes = includes;
+ m_excludes = excludes;
}
/**
@@ -78,5 +98,15 @@
public IncludeDirective[] getIncludes()
{
return m_includes;
+ }
+
+ /**
+ * Return the set of exclude directives.
+ *
+ * @return the exclude set
+ */
+ public ExcludeDirective[] getExcludes()
+ {
+ return m_excludes;
}
}
1.1 avalon/merlin/composition/api/src/java/org/apache/avalon/composition/data/ExcludeDirective.java
Index: ExcludeDirective.java
===================================================================
/*
* Copyright 2004 Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.avalon.composition.data;
import java.io.Serializable;
/**
* <p>A file exclude directive.</p>
* <p><b>XML</b></p>
* <p>An exclude element is normally contained within a scoping structure such as a
* fileset or directory set. The exclude element contains the single attribute name
* which is used to refer to the file or directory (depending on the containing
* context.</p>
* <pre>
* <font color="gray"><fileset dir="lib"></font>
* <exclude name="<font color="darkred">avalon-framework.jar</font>" />
* <font color="gray"></fileset></font>
* </pre>
*
* @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
* @version $Revision: 1.1 $ $Date: 2004/04/16 19:55:11 $
*/
public class ExcludeDirective implements Serializable
{
/**
* The base directory
*/
private final String m_path;
/**
* Create an ExcludeDirective instance.
*
* @param path the path to include
*/
public ExcludeDirective( final String path )
{
m_path = path;
}
/**
* Return the excluded path.
*
* @return the path
*/
public String getPath()
{
return m_path;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org