Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 4973 invoked from network); 16 Nov 2006 23:15:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Nov 2006 23:15:16 -0000 Received: (qmail 39678 invoked by uid 500); 16 Nov 2006 23:15:26 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 39354 invoked by uid 500); 16 Nov 2006 23:15:26 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 39339 invoked by uid 500); 16 Nov 2006 23:15:26 -0000 Received: (qmail 39335 invoked by uid 99); 16 Nov 2006 23:15:26 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 15:15:26 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 15:15:14 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id E69031A9846; Thu, 16 Nov 2006 15:14:42 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r475974 - in /ant/core/trunk/src/main/org/apache/tools/ant/types/selectors: ./ modifiedselector/ Date: Thu, 16 Nov 2006 23:14:42 -0000 To: ant-cvs@apache.org From: peterreilly@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061116231442.E69031A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: peterreilly Date: Thu Nov 16 15:14:41 2006 New Revision: 475974 URL: http://svn.apache.org/viewvc?view=rev&rev=475974 Log: checkstyle Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/BaseExtendSelector.java ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ContainsRegexpSelector.java ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/DepthSelector.java ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SignedSelector.java ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/BaseExtendSelector.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/BaseExtendSelector.java?view=diff&rev=475974&r1=475973&r2=475974 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/BaseExtendSelector.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/BaseExtendSelector.java Thu Nov 16 15:14:41 2006 @@ -34,8 +34,12 @@ extends BaseSelector implements ExtendFileSelector { + // CheckStyle:VisibilityModifier OFF - bc + /** The passed in parameter array. */ protected Parameter[] parameters = null; + + // CheckStyle:VisibilityModifier ON /** * Default constructor. Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ContainsRegexpSelector.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ContainsRegexpSelector.java?view=diff&rev=475974&r1=475973&r2=475974 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ContainsRegexpSelector.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ContainsRegexpSelector.java Thu Nov 16 15:14:41 2006 @@ -20,7 +20,6 @@ import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java?view=diff&rev=475974&r1=475973&r2=475974 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/ContainsSelector.java Thu Nov 16 15:14:41 2006 @@ -20,7 +20,6 @@ import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/DepthSelector.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/DepthSelector.java?view=diff&rev=475974&r1=475973&r2=475974 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/DepthSelector.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/DepthSelector.java Thu Nov 16 15:14:41 2006 @@ -32,10 +32,15 @@ */ public class DepthSelector extends BaseExtendSelector { + // CheckStyle:VisibilityModifier OFF - bc + /** min attribute */ public int min = -1; /** max attribute */ public int max = -1; + + // CheckStyle:VisibilityModifier ON + /** Used for parameterized custom selector */ public static final String MIN_KEY = "min"; /** Used for parameterized custom selector */ Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java?view=diff&rev=475974&r1=475973&r2=475974 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/MappingSelector.java Thu Nov 16 15:14:41 2006 @@ -35,10 +35,14 @@ /** Utilities used for file operations */ private static final FileUtils FILE_UTILS = FileUtils.getFileUtils(); + // CheckStyle:VisibilityModifier OFF - bc + protected File targetdir = null; protected Mapper mapperElement = null; protected FileNameMapper map = null; protected int granularity = 0; + + // CheckStyle:VisibilityModifier ON /** * Creates a new MappingSelector instance. Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SignedSelector.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SignedSelector.java?view=diff&rev=475974&r1=475973&r2=475974 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SignedSelector.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/SignedSelector.java Thu Nov 16 15:14:41 2006 @@ -27,7 +27,7 @@ * @since 1.7 */ public class SignedSelector extends DataType implements FileSelector { - IsSigned isSigned = new IsSigned(); + private IsSigned isSigned = new IsSigned(); /** * The signature name to check jarfile for. Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java?view=diff&rev=475974&r1=475973&r2=475974 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/selectors/modifiedselector/ModifiedSelector.java Thu Nov 16 15:14:41 2006 @@ -52,53 +52,53 @@ * *

The ModifiedSelector is implemented as a CoreSelector and uses default * values for all its attributes therefore the simpliest example is

- *   
- *       
- *           
- *       
- *   
+ *   <copy todir="dest">
+ *       <filelist dir="src">
+ *           <modified/>
+ *       </filelist>
+ *   </copy>
  * 

* *

The same example rewritten as CoreSelector with setting the all values * (same as defaults are) would be

- *   
- *       
- *           
- *               
- *               
- *           
- *       
- *   
+ *                     comparator="equal">
+ *               <param name="cache.cachefile"     value="cache.properties"/>
+ *               <param name="algorithm.algorithm" value="MD5"/>
+ *           </modified>
+ *       </filelist>
+ *   </copy>
  * 

* *

And the same rewritten as CustomSelector would be

- *   
- *       
- *           
- *               
- *               
- *               
- *               
- *               
- *               
- *           
- *       
- *   
+ *   <copy todir="dest">
+ *       <filelist dir="src">
+ *           <custom class="org.apache.tools.ant.type.selectors.ModifiedSelector">
+ *               <param name="update"     value="true"/>
+ *               <param name="cache"      value="propertyfile"/>
+ *               <param name="algorithm"  value="digest"/>
+ *               <param name="comparator" value="equal"/>
+ *               <param name="cache.cachefile"     value="cache.properties"/>
+ *               <param name="algorithm.algorithm" value="MD5"/>
+ *           </custom>
+ *       </filelist>
+ *   </copy>
  * 

* *

If you want to provide your own interface implementation you can do * that via the *classname attributes. If the classes are not on Ant's core * classpath, you will have to provide the path via nested <classpath> * element, so that the selector can find the classes.

- *   
- *       
- *           
- *       
- *   
- * 

+ * <modified cacheclassname="com.mycompany.MyCache"> + * <classpath> + * <pathelement location="lib/mycompony-antutil.jar"/> + * </classpath> + * </modified> + *

* *

All these three examples copy the files from src to dest * using the ModifiedSelector. The ModifiedSelector uses the PropertyfileCache @@ -116,114 +116,20 @@ *

A useful scenario for this selector is inside a build environment * for homepage generation (e.g. with * Apache Forrest).

- * 
- *      generate the site using forrest 
- *     
- *
- *      upload the changed files 
- *     
- *         
- *             
- *         
- *     
- * 
+ * <target name="generate-and-upload-site">
+ *     <echo> generate the site using forrest </echo>
+ *     <antcall target="site"/>
+ *
+ *     <echo> upload the changed files </echo>
+ *     <ftp server="${ftp.server}" userid="${ftp.user}" password="${ftp.pwd}">
+ *         <fileset dir="htdocs/manual">
+ *             <modified/>
+ *         </fileset>
+ *     </ftp>
+ * </target>
  * 
Here all changed files are uploaded to the server. The * ModifiedSelector saves therefore much upload time.

* - *

This selector supports the following attributes: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
namevaluesdescriptionrequired
cache propertyfile which cache implementation should be used
    - *
  • propertyfile - using java.util.Properties
  • - *
no, defaults to 'propertyfile'
algorithm hashvalue | digest | checksum which algorithm implementation should be used - *
  • hashvalue - loads the file content into a String and - * uses its hashValue() method
  • - *
  • digest - uses java.security.MessageDigest class - *
  • checksum - uses java.util.zip.Checksum interface - *
  • no, defaults to digest
    comparator equal | rule which comparator implementation should be used - *
  • equal - simple comparison using String.equals()
  • - *
  • rule - uses java.text.RuleBasedCollator class - *
  • no, defaults to equal
    update true | false If set to true, the cache will be stored, otherwise the values - * will be lost. no, defaults to true
    seldirs true | false If set to true, directories will be selected otherwise not no, defaults to true
    delayupdate true | false If set to true, the storage of the cache will be delayed until the - * next finished BuildEvent; task finished, target finished or build finished, - * whichever comes first. This is provided for increased performance. If set - * to false, the storage of the cache will happen with each change. This - * attribute depends upon the update attribute. no, defaults to true
    cacheclass classname which custom cache implementation should be used no
    algorithmclass classname which custom algorithm implementation should be used no
    comparatorclass classname which custom comparator implementation should be used no
    cache.* depends on used cache value is stored and given to the Cache-Object for initialisation depends on used cache
    algorithm.* depends on used algorithm value is stored and given to the Algorithm-Object for initialisation depends on used algorithm
    comparator.* depends on used comparator value is stored and given to the Comparator-Object for initialisation depends on used comparator
    - * If another name is used a BuildException "Invalid parameter" is thrown.

    - * - *

    Additionally this selector supports a nested <classpath>.

    * *

    This selector uses reflection for setting the values of its three interfaces * (using org.apache.tools.ant.IntrospectionHelper) therefore no special @@ -231,10 +137,9 @@ * comparators. All present setXX methods can be used. E.g. the DigestAlgorithm * can use a specified provider for computing its value. For selecting this * there is a setProvider(String providername) method. So you can use - * a nested . + * a nested <param name="algorithm.provider" value="MyProvider"/>. * * - * @version 2005-07-19 * @since Ant 1.6 */ public class ModifiedSelector extends BaseExtendSelector @@ -524,7 +429,7 @@ * * @param resource The resource to check * @return whether the resource is selected - * @see org.apache.tools.ant.types.resources.selectors.ResourceSelector#isSelected(org.apache.tools.ant.types.Resource) + * @see ResourceSelector#isSelected(Resource) */ public boolean isSelected(Resource resource) { if (resource.isFilesystemOnly()) { @@ -785,6 +690,7 @@ * Overwrite implementation in superclass because only special * parameters are valid. * @see #addParam(String,Object). + * @param parameters the parameters to set. */ public void setParameters(Parameter[] parameters) { if (parameters != null) { @@ -991,6 +897,7 @@ */ public static class CacheName extends EnumeratedAttribute { /** @see EnumeratedAttribute#getValues() */ + /** {@inheritDoc} */ public String[] getValues() { return new String[] {"propertyfile" }; } @@ -1016,6 +923,7 @@ */ public static class AlgorithmName extends EnumeratedAttribute { /** @see EnumeratedAttribute#getValues() */ + /** {@inheritDoc} */ public String[] getValues() { return new String[] {"hashvalue", "digest", "checksum" }; } @@ -1041,6 +949,7 @@ */ public static class ComparatorName extends EnumeratedAttribute { /** @see EnumeratedAttribute#getValues() */ + /** {@inheritDoc} */ public String[] getValues() { return new String[] {"equal", "rule" }; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org