Changeset 2624
- Timestamp:
- 01/05/10 13:38:47
- Files:
-
- trunk/deployutil/build.xml (modified) (1 diff)
- trunk/deployutil/src/org/bedework/deployment/ApplicationXmlTask.java (modified) (11 diffs)
- trunk/deployutil/src/org/bedework/deployment/ForEachAppTask.java (modified) (8 diffs)
- trunk/deployutil/src/org/bedework/deployment/MakeLangXsl.java (modified) (19 diffs)
- trunk/deployutil/src/org/bedework/deployment/ResolveFile.java (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployutil/build.xml
r2014 r2624 31 31 32 32 <target name="build" depends="init" 33 description="Compile bedework loggingclasses">33 description="Compile bedework deployutil classes"> 34 34 <!-- ==================== Sources and classes ====================== --> 35 35 trunk/deployutil/src/org/bedework/deployment/ApplicationXmlTask.java
r1991 r2624 1 /*2 Copyright (c) 2000-2005 University of Washington. All rights reserved.3 4 Redistribution and use of this distribution in source and binary forms,5 with or without modification, are permitted provided that:6 7 The above copyright notice and this permission notice appear in8 all copies and supporting documentation;9 10 The name, identifiers, and trademarks of the University of Washington11 are not used in advertising or publicity without the express prior12 written permission of the University of Washington;13 14 Recipients acknowledge that this distribution is made available as a15 research courtesy, "as is", potentially with defects, without16 any obligation on the part of the University of Washington to17 provide support, services, or repair;18 19 THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR20 IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION21 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A22 PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF23 WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL24 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR25 PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING26 NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH27 THE USE OR PERFORMANCE OF THIS SOFTWARE.28 */29 1 /* ********************************************************************** 30 Copyright 20 05Rensselaer Polytechnic Institute. All worldwide rights reserved.2 Copyright 2010 Rensselaer Polytechnic Institute. All worldwide rights reserved. 31 3 32 4 Redistribution and use of this distribution in source and binary forms, … … 54 26 package org.bedework.deployment; 55 27 28 import org.apache.tools.ant.BuildException; 29 import org.apache.tools.ant.DirectoryScanner; 30 import org.apache.tools.ant.taskdefs.MatchingTask; 31 import org.apache.tools.ant.types.FileSet; 32 import org.apache.tools.ant.util.FileUtils; 33 56 34 import java.io.File; 57 35 import java.io.FileInputStream; … … 62 40 import java.util.List; 63 41 import java.util.Properties; 64 65 import org.apache.tools.ant.BuildException;66 import org.apache.tools.ant.DirectoryScanner;67 import org.apache.tools.ant.taskdefs.MatchingTask;68 import org.apache.tools.ant.types.FileSet;69 import org.apache.tools.ant.util.FileUtils;70 42 71 43 /** Ant task to build the application.xml file for a ear. … … 104 76 * @param set 105 77 */ 106 public void addFileset( FileSet set) {78 public void addFileset(final FileSet set) { 107 79 filesets.add(set); 108 80 } … … 112 84 * @param val String 113 85 */ 114 public void setDisplayName( String val) {86 public void setDisplayName(final String val) { 115 87 displayName = val; 116 88 } … … 120 92 * @param val String 121 93 */ 122 public void setContexts( String val) {94 public void setContexts(final String val) { 123 95 contexts = val; 124 96 } … … 128 100 * @param val File 129 101 */ 130 public void setOutFile( File val) {102 public void setOutFile(final File val) { 131 103 outFile = val; 132 104 } … … 136 108 * @param val File 137 109 */ 138 public void setWarDir( File val) {110 public void setWarDir(final File val) { 139 111 warDir = val; 140 112 } … … 142 114 /** Executes the task 143 115 */ 116 @Override 144 117 public void execute() throws BuildException { 145 118 try { … … 218 191 private void getModules() throws BuildException { 219 192 FilenameFilter fltr = new FilenameFilter() { 220 public boolean accept( File dir,String name) {193 public boolean accept(final File dir, final String name) { 221 194 return name.endsWith(".war"); 222 195 } … … 249 222 } 250 223 251 private void writeLine( String ln) throws Throwable {224 private void writeLine(final String ln) throws Throwable { 252 225 wtr.write(ln); 253 226 wtr.write("\n"); trunk/deployutil/src/org/bedework/deployment/ForEachAppTask.java
r1937 r2624 1 /*2 Copyright (c) 2000-2005 University of Washington. All rights reserved.3 4 Redistribution and use of this distribution in source and binary forms,5 with or without modification, are permitted provided that:6 7 The above copyright notice and this permission notice appear in8 all copies and supporting documentation;9 10 The name, identifiers, and trademarks of the University of Washington11 are not used in advertising or publicity without the express prior12 written permission of the University of Washington;13 14 Recipients acknowledge that this distribution is made available as a15 research courtesy, "as is", potentially with defects, without16 any obligation on the part of the University of Washington to17 provide support, services, or repair;18 19 THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR20 IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION21 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A22 PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF23 WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL24 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR25 PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING26 NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH27 THE USE OR PERFORMANCE OF THIS SOFTWARE.28 */29 1 /* ********************************************************************** 30 Copyright 20 05Rensselaer Polytechnic Institute. All worldwide rights reserved.2 Copyright 2010 Rensselaer Polytechnic Institute. All worldwide rights reserved. 31 3 32 4 Redistribution and use of this distribution in source and binary forms, … … 54 26 package org.bedework.deployment; 55 27 28 import org.apache.tools.ant.BuildException; 29 import org.apache.tools.ant.PropertyHelper; 30 import org.apache.tools.ant.taskdefs.Sequential; 31 56 32 import java.util.Iterator; 57 33 import java.util.LinkedList; 58 34 import java.util.List; 59 35 import java.util.StringTokenizer; 60 61 import org.apache.tools.ant.BuildException;62 import org.apache.tools.ant.PropertyHelper;63 import org.apache.tools.ant.taskdefs.Sequential;64 36 65 37 /** Ant task to build the applications based on a list of names … … 98 70 * @param val String 99 71 */ 100 public void setNames( String val) {72 public void setNames(final String val) { 101 73 names = val; 102 74 } … … 106 78 * @param val String 107 79 */ 108 public void setPrefix( String val) {80 public void setPrefix(final String val) { 109 81 prefix = val; 110 82 } … … 114 86 * @param val String 115 87 */ 116 public void setAppPrefix( String val) {88 public void setAppPrefix(final String val) { 117 89 appPrefix = val; 118 90 } … … 122 94 * @param val String 123 95 */ 124 public void setProjectPrefix( String val) {96 public void setProjectPrefix(final String val) { 125 97 projectPrefix = val; 126 98 } … … 128 100 /** Execute the task 129 101 */ 102 @Override 130 103 public void execute() throws BuildException { 131 104 try { … … 214 187 /* Turn a comma separated list into a List 215 188 */ 216 private List getList( String val) throws BuildException {189 private List getList(final String val) throws BuildException { 217 190 List<String> l = new LinkedList<String>(); 218 191 trunk/deployutil/src/org/bedework/deployment/MakeLangXsl.java
r1869 r2624 1 /*2 Copyright (c) 2000-2005 University of Washington. All rights reserved.3 4 Redistribution and use of this distribution in source and binary forms,5 with or without modification, are permitted provided that:6 7 The above copyright notice and this permission notice appear in8 all copies and supporting documentation;9 10 The name, identifiers, and trademarks of the University of Washington11 are not used in advertising or publicity without the express prior12 written permission of the University of Washington;13 14 Recipients acknowledge that this distribution is made available as a15 research courtesy, "as is", potentially with defects, without16 any obligation on the part of the University of Washington to17 provide support, services, or repair;18 19 THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR20 IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION21 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A22 PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF23 WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL24 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR25 PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING26 NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH27 THE USE OR PERFORMANCE OF THIS SOFTWARE.28 */29 1 /* ********************************************************************** 30 Copyright 20 05Rensselaer Polytechnic Institute. All worldwide rights reserved.2 Copyright 2010 Rensselaer Polytechnic Institute. All worldwide rights reserved. 31 3 32 4 Redistribution and use of this distribution in source and binary forms, … … 54 26 package org.bedework.deployment; 55 27 28 import org.apache.tools.ant.BuildException; 29 import org.apache.tools.ant.PropertyHelper; 30 import org.apache.tools.ant.Task; 31 import org.apache.tools.ant.util.FileUtils; 32 56 33 import java.io.File; 57 34 import java.io.FileInputStream; … … 66 43 import java.util.TreeMap; 67 44 import java.util.TreeSet; 68 69 import org.apache.tools.ant.BuildException;70 import org.apache.tools.ant.PropertyHelper;71 import org.apache.tools.ant.Task;72 import org.apache.tools.ant.util.FileUtils;73 45 74 46 /** Ant task to build the xsl parameters used by the stylesheets for language … … 107 79 * @param val File 108 80 */ 109 public void setDir( File val) {81 public void setDir(final File val) { 110 82 dir = val; 111 83 } … … 115 87 * @param val File 116 88 */ 117 public void setResdir( File val) {89 public void setResdir(final File val) { 118 90 resdir = val; 119 91 } … … 123 95 * @param val File 124 96 */ 125 public void setXsldir( File val) {97 public void setXsldir(final File val) { 126 98 xsldir = val; 127 99 } … … 131 103 * @param val String 132 104 */ 133 public void setPrefix( String val) {105 public void setPrefix(final String val) { 134 106 prefix = val; 135 107 adjustedPrefix = prefix + "_"; … … 140 112 * @param val property name 141 113 */ 142 public void setName( String val) {114 public void setName(final String val) { 143 115 name = val; 144 116 } … … 154 126 * @param val true for checking 155 127 */ 156 public void setCheck( boolean val) {128 public void setCheck(final boolean val) { 157 129 check = val; 158 130 } … … 160 132 /** Execute the task 161 133 */ 134 @Override 162 135 public void execute() throws BuildException { 163 136 try { … … 221 194 222 195 FilenameFilter fltr = new FilenameFilter() { 223 public boolean accept( File dir,String name) {196 public boolean accept(final File dir, final String name) { 224 197 return name.startsWith(adjustedPrefix) && 225 198 name.endsWith(suffix); … … 238 211 } 239 212 240 if (check && fnames.size() > 1) {213 if (check && (fnames.size() > 1)) { 241 214 checkResources(fnames); 242 215 } … … 245 218 } 246 219 247 private void makeXsl( String fname) throws BuildException {220 private void makeXsl(final String fname) throws BuildException { 248 221 try { 249 222 String locale = makeLocale(fname); … … 276 249 } 277 250 278 private String formatLine( String key) {251 private String formatLine(final String key) { 279 252 return String.format(" <xsl:param name=\"%s\" />", key); 280 253 } 281 254 282 private void xslLine( String ln) throws Throwable {255 private void xslLine(final String ln) throws Throwable { 283 256 wtr.write(ln); 284 257 wtr.write("\n"); 285 258 } 286 259 287 private String makeLocale( String fname) {260 private String makeLocale(final String fname) { 288 261 String s = fname.substring(adjustedPrefix.length()); 289 262 … … 299 272 boolean[] flags; 300 273 301 int first( boolean val) {274 int first(final boolean val) { 302 275 for (int i = 0; i < flags.length; i++) { 303 276 if (flags[i] == val) { … … 310 283 } 311 284 312 private Properties getProps( String fname) throws BuildException {285 private Properties getProps(final String fname) throws BuildException { 313 286 try { 314 287 FileInputStream propFile = new FileInputStream(dir.getAbsolutePath() + … … 323 296 } 324 297 325 private void checkResources( List<String> fnames) throws BuildException {298 private void checkResources(final List<String> fnames) throws BuildException { 326 299 List<TreeSet<String>> propNamesList = new LinkedList<TreeSet<String>>(); 327 300 int fnamesSz = fnames.size(); … … 389 362 } 390 363 391 private void mapPropNames( int i,392 List<String> fnames,393 TreeSet<String> propNames,394 SortedMap<String, FnameMapEntry> nameMap) throws BuildException {364 private void mapPropNames(final int i, 365 final List<String> fnames, 366 final TreeSet<String> propNames, 367 final SortedMap<String, FnameMapEntry> nameMap) throws BuildException { 395 368 for (String name: propNames) { 396 369 FnameMapEntry fme = nameMap.get(name); … … 407 380 } 408 381 409 private boolean inAllOthers( int i,String name,410 List<TreeSet<String>> propNamesList) {382 private boolean inAllOthers(final int i, final String name, 383 final List<TreeSet<String>> propNamesList) { 411 384 for (int j = 0; j < propNamesList.size(); j++) { 412 385 if (j == i) { trunk/deployutil/src/org/bedework/deployment/ResolveFile.java
r1869 r2624 1 /*2 Copyright (c) 2000-2005 University of Washington. All rights reserved.3 4 Redistribution and use of this distribution in source and binary forms,5 with or without modification, are permitted provided that:6 7 The above copyright notice and this permission notice appear in8 all copies and supporting documentation;9 10 The name, identifiers, and trademarks of the University of Washington11 are not used in advertising or publicity without the express prior12 written permission of the University of Washington;13 14 Recipients acknowledge that this distribution is made available as a15 research courtesy, "as is", potentially with defects, without16 any obligation on the part of the University of Washington to17 provide support, services, or repair;18 19 THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR20 IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION21 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A22 PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF23 WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL24 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR25 PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING26 NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH27 THE USE OR PERFORMANCE OF THIS SOFTWARE.28 */29 1 /* ********************************************************************** 30 Copyright 20 05Rensselaer Polytechnic Institute. All worldwide rights reserved.2 Copyright 2010 Rensselaer Polytechnic Institute. All worldwide rights reserved. 31 3 32 4 Redistribution and use of this distribution in source and binary forms, … … 54 26 package org.bedework.deployment; 55 27 56 import java.io.File;57 58 28 import org.apache.tools.ant.BuildException; 59 29 import org.apache.tools.ant.PropertyHelper; 60 30 import org.apache.tools.ant.Task; 61 31 import org.apache.tools.ant.util.FileUtils; 32 33 import java.io.File; 62 34 63 35 /** Ant task to resolve a file name. This is just a wrapper to the ant FileUtils … … 86 58 * @param name property name 87 59 */ 88 public void setName( String name) {60 public void setName(final String name) { 89 61 this.name = name; 90 62 } … … 102 74 * @param val filename 103 75 */ 104 public void setBase( File val) {76 public void setBase(final File val) { 105 77 base = val; 106 78 } … … 119 91 * @ant.attribute group="noname" 120 92 */ 121 public void setFile( String val) {93 public void setFile(final String val) { 122 94 file = new File(val); 123 95 } … … 125 97 /** Execute the task 126 98 */ 99 @Override 127 100 public void execute() throws BuildException { 128 101 try {
