Changeset 17349 for other-projects/trunk/anttasks/src
- Timestamp:
- 2008-09-19T13:50:50+12:00 (16 years ago)
- Location:
- other-projects/trunk/anttasks
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/trunk/anttasks
- Property svn:ignore
-
old new 1 1 classes 2 2 lib 3 test 3 4
-
- Property svn:ignore
-
other-projects/trunk/anttasks/src/org/greenstone/anttasks/RegexSearchReplace.java
r17303 r17349 130 130 String oldLine = line; 131 131 if ( pattern != null ) { 132 line = line.replaceAll((String)pattern, (String)replacement); 132 String rp = replacement; 133 if ( winPath ) { 134 rp = rp.replaceAll("\\\\","\\\\\\\\"); 135 } 136 line = line.replaceAll((String)pattern, (String)rp); 133 137 } else { 134 138 for ( int i=0; i<jobs.size(); i++ ) { 135 139 String rp = ((RegexSearchReplaceJob)(jobs.get(i))).getReplacement(); 136 if ( winPath) {140 if ( ((RegexSearchReplaceJob)(jobs.get(i))).getWinPath() ) { 137 141 rp = rp.replaceAll("\\\\","\\\\\\\\"); 138 142 } … … 211 215 public void setReplacement(String replacement) { 212 216 replacement = replacement.replaceAll( "\\\\", "\\\\\\\\" ); 213 if ( winPath ) {214 replacement = replacement.replaceAll("\\\\","\\\\\\\\");215 }216 217 this.replacement = replacement; 217 218 } -
other-projects/trunk/anttasks/src/org/greenstone/anttasks/RegexSearchReplaceJob.java
r17295 r17349 2 2 public class RegexSearchReplaceJob extends org.apache.tools.ant.types.DataType { 3 3 4 public String pattern = null; 5 public String replacement = null; 4 String pattern = null; 5 String replacement = null; 6 boolean winPath = false; 6 7 7 8 public void setPattern(String pattern) { … … 14 15 } 15 16 17 public void setWinPath( boolean winPath ) { 18 this.winPath = winPath; 19 } 20 16 21 public String getPattern() { 17 22 return pattern; … … 20 25 return replacement; 21 26 } 27 public boolean getWinPath() { 28 return winPath; 29 } 22 30 23 31 }
Note:
See TracChangeset
for help on using the changeset viewer.