git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270477 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -21,7 +21,8 @@ import org.apache.tools.ant.Task; | |||
| * @author Gero Vermaas <a href="mailto:gero@xs4all.nl">gero@xs4all.nl</a> | |||
| * @author <A href="gholam@xtra.co.nz">Michael McCallum</A> | |||
| */ | |||
| public class Filter extends Task | |||
| public class Filter | |||
| extends Task | |||
| { | |||
| private File filtersFile; | |||
| @@ -94,12 +94,12 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| */ | |||
| public void addDefaultExcludes() | |||
| { | |||
| int excludesLength = excludes == null ? 0 : excludes.length; | |||
| int excludesLength = getExcludes() == null ? 0 : getExcludes().length; | |||
| String[] newExcludes; | |||
| newExcludes = new String[ excludesLength + DEFAULTEXCLUDES.length ]; | |||
| if( excludesLength > 0 ) | |||
| { | |||
| System.arraycopy( excludes, 0, newExcludes, 0, excludesLength ); | |||
| System.arraycopy( getExcludes(), 0, newExcludes, 0, excludesLength ); | |||
| } | |||
| for( int i = 0; i < DEFAULTEXCLUDES.length; i++ ) | |||
| { | |||
| @@ -107,7 +107,7 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| replace( '/', File.separatorChar ). | |||
| replace( '\\', File.separatorChar ); | |||
| } | |||
| excludes = newExcludes; | |||
| setExcludes( newExcludes ); | |||
| } | |||
| /** | |||
| @@ -125,10 +125,10 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| for( int i = 0; i < projects.length; i++ ) | |||
| { | |||
| Project project = projects[ i ]; | |||
| for( int j = 0; j < includes.length && !allProjectsMatch; j++ ) | |||
| for( int j = 0; j < getIncludes().length && !allProjectsMatch; j++ ) | |||
| { | |||
| StringTokenizer tok = | |||
| new StringTokenizer( includes[ j ], File.separator ); | |||
| new StringTokenizer( getIncludes()[ j ], File.separator ); | |||
| String projectNamePattern = tok.nextToken(); | |||
| if( projectNamePattern.equals( "**" ) ) | |||
| { | |||
| @@ -162,15 +162,15 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| */ | |||
| public void scan() | |||
| { | |||
| if( includes == null ) | |||
| if( getIncludes() == null ) | |||
| { | |||
| // No includes supplied, so set it to 'matches all' | |||
| includes = new String[ 1 ]; | |||
| includes[ 0 ] = "**"; | |||
| setIncludes( new String[ 1 ] ); | |||
| getIncludes()[ 0 ] = "**"; | |||
| } | |||
| if( excludes == null ) | |||
| if( getExcludes() == null ) | |||
| { | |||
| excludes = new String[ 0 ]; | |||
| setExcludes( new String[ 0 ] ); | |||
| } | |||
| // only scan projects which are included in at least one include pattern | |||
| @@ -962,23 +962,23 @@ public class FTP | |||
| public void scan() | |||
| { | |||
| if( includes == null ) | |||
| if( getIncludes() == null ) | |||
| { | |||
| // No includes supplied, so set it to 'matches all' | |||
| includes = new String[ 1 ]; | |||
| includes[ 0 ] = "**"; | |||
| setIncludes( new String[ 1 ] ); | |||
| getIncludes()[ 0 ] = "**"; | |||
| } | |||
| if( excludes == null ) | |||
| if( getExcludes() == null ) | |||
| { | |||
| excludes = new String[ 0 ]; | |||
| setExcludes( new String[ 0 ] ); | |||
| } | |||
| filesIncluded = new ArrayList(); | |||
| filesNotIncluded = new ArrayList(); | |||
| filesExcluded = new ArrayList(); | |||
| dirsIncluded = new ArrayList(); | |||
| dirsNotIncluded = new ArrayList(); | |||
| dirsExcluded = new ArrayList(); | |||
| setFilesIncluded( new ArrayList() ); | |||
| setFilesNotIncluded( new ArrayList() ); | |||
| setFilesExcluded( new ArrayList() ); | |||
| setDirsIncluded( new ArrayList() ); | |||
| setDirsNotIncluded( new ArrayList() ); | |||
| setDirsExcluded( new ArrayList() ); | |||
| try | |||
| { | |||
| @@ -1020,7 +1020,7 @@ public class FTP | |||
| { | |||
| if( !isExcluded( name ) ) | |||
| { | |||
| dirsIncluded.add( name ); | |||
| getDirsIncluded().add( name ); | |||
| if( fast ) | |||
| { | |||
| scandir( name, vpath + name + File.separator, fast ); | |||
| @@ -1028,12 +1028,12 @@ public class FTP | |||
| } | |||
| else | |||
| { | |||
| dirsExcluded.add( name ); | |||
| getDirsExcluded().add( name ); | |||
| } | |||
| } | |||
| else | |||
| { | |||
| dirsNotIncluded.add( name ); | |||
| getDirsNotIncluded().add( name ); | |||
| if( fast && couldHoldIncluded( name ) ) | |||
| { | |||
| scandir( name, vpath + name + File.separator, fast ); | |||
| @@ -1053,16 +1053,16 @@ public class FTP | |||
| { | |||
| if( !isExcluded( name ) ) | |||
| { | |||
| filesIncluded.add( name ); | |||
| getFilesIncluded().add( name ); | |||
| } | |||
| else | |||
| { | |||
| filesExcluded.add( name ); | |||
| getFilesExcluded().add( name ); | |||
| } | |||
| } | |||
| else | |||
| { | |||
| filesNotIncluded.add( name ); | |||
| getFilesNotIncluded().add( name ); | |||
| } | |||
| } | |||
| } | |||
| @@ -5,7 +5,7 @@ | |||
| * version 1.1, a copy of which has been included with this distribution in | |||
| * the LICENSE.txt file. | |||
| */ | |||
| package org.apache.tools.ant.taskdefs; | |||
| package org.apache.tools.ant.taskdefs.text; | |||
| import java.io.BufferedReader; | |||
| import java.io.BufferedWriter; | |||
| @@ -25,6 +25,7 @@ import java.util.Iterator; | |||
| import java.util.NoSuchElementException; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| @@ -70,9 +71,9 @@ import org.apache.tools.ant.util.FileUtils; | |||
| * @version $Revision$ $Name$ | |||
| */ | |||
| public class FixCRLF extends MatchingTask | |||
| public class FixCRLF | |||
| extends MatchingTask | |||
| { | |||
| private final static int UNDEF = -1; | |||
| private final static int NOTJAVA = 0; | |||
| private final static int LOOKING = 1; | |||
| @@ -125,7 +126,7 @@ public class FixCRLF extends MatchingTask | |||
| public FixCRLF() | |||
| { | |||
| tabs = ASIS; | |||
| if( System.getProperty( "path.separator" ).equals( ":" ) ) | |||
| if( File.pathSeparator.equals( ":" ) ) | |||
| { | |||
| ctrlz = REMOVE; | |||
| if( System.getProperty( "os.name" ).indexOf( "Mac" ) > -1 ) | |||
| @@ -5,7 +5,7 @@ | |||
| * version 1.1, a copy of which has been included with this distribution in | |||
| * the LICENSE.txt file. | |||
| */ | |||
| package org.apache.tools.ant.taskdefs; | |||
| package org.apache.tools.ant.taskdefs.text; | |||
| public class NestedString | |||
| { | |||
| @@ -5,7 +5,7 @@ | |||
| * version 1.1, a copy of which has been included with this distribution in | |||
| * the LICENSE.txt file. | |||
| */ | |||
| package org.apache.tools.ant.taskdefs; | |||
| package org.apache.tools.ant.taskdefs.text; | |||
| import java.io.BufferedReader; | |||
| import java.io.BufferedWriter; | |||
| @@ -24,6 +24,7 @@ import java.util.ArrayList; | |||
| import java.util.Properties; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.avalon.excalibur.util.StringUtil; | |||
| /** | |||
| @@ -5,7 +5,7 @@ | |||
| * version 1.1, a copy of which has been included with this distribution in | |||
| * the LICENSE.txt file. | |||
| */ | |||
| package org.apache.tools.ant.taskdefs; | |||
| package org.apache.tools.ant.taskdefs.text; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| @@ -21,7 +21,8 @@ import org.apache.tools.ant.Task; | |||
| * @author Gero Vermaas <a href="mailto:gero@xs4all.nl">gero@xs4all.nl</a> | |||
| * @author <A href="gholam@xtra.co.nz">Michael McCallum</A> | |||
| */ | |||
| public class Filter extends Task | |||
| public class Filter | |||
| extends Task | |||
| { | |||
| private File filtersFile; | |||
| @@ -94,12 +94,12 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| */ | |||
| public void addDefaultExcludes() | |||
| { | |||
| int excludesLength = excludes == null ? 0 : excludes.length; | |||
| int excludesLength = getExcludes() == null ? 0 : getExcludes().length; | |||
| String[] newExcludes; | |||
| newExcludes = new String[ excludesLength + DEFAULTEXCLUDES.length ]; | |||
| if( excludesLength > 0 ) | |||
| { | |||
| System.arraycopy( excludes, 0, newExcludes, 0, excludesLength ); | |||
| System.arraycopy( getExcludes(), 0, newExcludes, 0, excludesLength ); | |||
| } | |||
| for( int i = 0; i < DEFAULTEXCLUDES.length; i++ ) | |||
| { | |||
| @@ -107,7 +107,7 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| replace( '/', File.separatorChar ). | |||
| replace( '\\', File.separatorChar ); | |||
| } | |||
| excludes = newExcludes; | |||
| setExcludes( newExcludes ); | |||
| } | |||
| /** | |||
| @@ -125,10 +125,10 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| for( int i = 0; i < projects.length; i++ ) | |||
| { | |||
| Project project = projects[ i ]; | |||
| for( int j = 0; j < includes.length && !allProjectsMatch; j++ ) | |||
| for( int j = 0; j < getIncludes().length && !allProjectsMatch; j++ ) | |||
| { | |||
| StringTokenizer tok = | |||
| new StringTokenizer( includes[ j ], File.separator ); | |||
| new StringTokenizer( getIncludes()[ j ], File.separator ); | |||
| String projectNamePattern = tok.nextToken(); | |||
| if( projectNamePattern.equals( "**" ) ) | |||
| { | |||
| @@ -162,15 +162,15 @@ class VAJWorkspaceScanner extends DirectoryScanner | |||
| */ | |||
| public void scan() | |||
| { | |||
| if( includes == null ) | |||
| if( getIncludes() == null ) | |||
| { | |||
| // No includes supplied, so set it to 'matches all' | |||
| includes = new String[ 1 ]; | |||
| includes[ 0 ] = "**"; | |||
| setIncludes( new String[ 1 ] ); | |||
| getIncludes()[ 0 ] = "**"; | |||
| } | |||
| if( excludes == null ) | |||
| if( getExcludes() == null ) | |||
| { | |||
| excludes = new String[ 0 ]; | |||
| setExcludes( new String[ 0 ] ); | |||
| } | |||
| // only scan projects which are included in at least one include pattern | |||
| @@ -962,23 +962,23 @@ public class FTP | |||
| public void scan() | |||
| { | |||
| if( includes == null ) | |||
| if( getIncludes() == null ) | |||
| { | |||
| // No includes supplied, so set it to 'matches all' | |||
| includes = new String[ 1 ]; | |||
| includes[ 0 ] = "**"; | |||
| setIncludes( new String[ 1 ] ); | |||
| getIncludes()[ 0 ] = "**"; | |||
| } | |||
| if( excludes == null ) | |||
| if( getExcludes() == null ) | |||
| { | |||
| excludes = new String[ 0 ]; | |||
| setExcludes( new String[ 0 ] ); | |||
| } | |||
| filesIncluded = new ArrayList(); | |||
| filesNotIncluded = new ArrayList(); | |||
| filesExcluded = new ArrayList(); | |||
| dirsIncluded = new ArrayList(); | |||
| dirsNotIncluded = new ArrayList(); | |||
| dirsExcluded = new ArrayList(); | |||
| setFilesIncluded( new ArrayList() ); | |||
| setFilesNotIncluded( new ArrayList() ); | |||
| setFilesExcluded( new ArrayList() ); | |||
| setDirsIncluded( new ArrayList() ); | |||
| setDirsNotIncluded( new ArrayList() ); | |||
| setDirsExcluded( new ArrayList() ); | |||
| try | |||
| { | |||
| @@ -1020,7 +1020,7 @@ public class FTP | |||
| { | |||
| if( !isExcluded( name ) ) | |||
| { | |||
| dirsIncluded.add( name ); | |||
| getDirsIncluded().add( name ); | |||
| if( fast ) | |||
| { | |||
| scandir( name, vpath + name + File.separator, fast ); | |||
| @@ -1028,12 +1028,12 @@ public class FTP | |||
| } | |||
| else | |||
| { | |||
| dirsExcluded.add( name ); | |||
| getDirsExcluded().add( name ); | |||
| } | |||
| } | |||
| else | |||
| { | |||
| dirsNotIncluded.add( name ); | |||
| getDirsNotIncluded().add( name ); | |||
| if( fast && couldHoldIncluded( name ) ) | |||
| { | |||
| scandir( name, vpath + name + File.separator, fast ); | |||
| @@ -1053,16 +1053,16 @@ public class FTP | |||
| { | |||
| if( !isExcluded( name ) ) | |||
| { | |||
| filesIncluded.add( name ); | |||
| getFilesIncluded().add( name ); | |||
| } | |||
| else | |||
| { | |||
| filesExcluded.add( name ); | |||
| getFilesExcluded().add( name ); | |||
| } | |||
| } | |||
| else | |||
| { | |||
| filesNotIncluded.add( name ); | |||
| getFilesNotIncluded().add( name ); | |||
| } | |||
| } | |||
| } | |||
| @@ -5,7 +5,7 @@ | |||
| * version 1.1, a copy of which has been included with this distribution in | |||
| * the LICENSE.txt file. | |||
| */ | |||
| package org.apache.tools.ant.taskdefs; | |||
| package org.apache.tools.ant.taskdefs.text; | |||
| import java.io.BufferedReader; | |||
| import java.io.BufferedWriter; | |||
| @@ -25,6 +25,7 @@ import java.util.Iterator; | |||
| import java.util.NoSuchElementException; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.tools.ant.types.EnumeratedAttribute; | |||
| import org.apache.tools.ant.util.FileUtils; | |||
| @@ -70,9 +71,9 @@ import org.apache.tools.ant.util.FileUtils; | |||
| * @version $Revision$ $Name$ | |||
| */ | |||
| public class FixCRLF extends MatchingTask | |||
| public class FixCRLF | |||
| extends MatchingTask | |||
| { | |||
| private final static int UNDEF = -1; | |||
| private final static int NOTJAVA = 0; | |||
| private final static int LOOKING = 1; | |||
| @@ -125,7 +126,7 @@ public class FixCRLF extends MatchingTask | |||
| public FixCRLF() | |||
| { | |||
| tabs = ASIS; | |||
| if( System.getProperty( "path.separator" ).equals( ":" ) ) | |||
| if( File.pathSeparator.equals( ":" ) ) | |||
| { | |||
| ctrlz = REMOVE; | |||
| if( System.getProperty( "os.name" ).indexOf( "Mac" ) > -1 ) | |||
| @@ -5,7 +5,7 @@ | |||
| * version 1.1, a copy of which has been included with this distribution in | |||
| * the LICENSE.txt file. | |||
| */ | |||
| package org.apache.tools.ant.taskdefs; | |||
| package org.apache.tools.ant.taskdefs.text; | |||
| public class NestedString | |||
| { | |||
| @@ -5,7 +5,7 @@ | |||
| * version 1.1, a copy of which has been included with this distribution in | |||
| * the LICENSE.txt file. | |||
| */ | |||
| package org.apache.tools.ant.taskdefs; | |||
| package org.apache.tools.ant.taskdefs.text; | |||
| import java.io.BufferedReader; | |||
| import java.io.BufferedWriter; | |||
| @@ -24,6 +24,7 @@ import java.util.ArrayList; | |||
| import java.util.Properties; | |||
| import org.apache.myrmidon.api.TaskException; | |||
| import org.apache.tools.ant.DirectoryScanner; | |||
| import org.apache.tools.ant.taskdefs.MatchingTask; | |||
| import org.apache.avalon.excalibur.util.StringUtil; | |||
| /** | |||
| @@ -5,7 +5,7 @@ | |||
| * version 1.1, a copy of which has been included with this distribution in | |||
| * the LICENSE.txt file. | |||
| */ | |||
| package org.apache.tools.ant.taskdefs; | |||
| package org.apache.tools.ant.taskdefs.text; | |||
| import org.apache.myrmidon.api.TaskException; | |||