Changeset 2624

Show
Ignore:
Timestamp:
01/05/10 13:38:47
Author:
douglm
Message:

Comment change

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployutil/build.xml

    r2014 r2624  
    3131 
    3232  <target name="build" depends="init" 
    33           description="Compile bedework logging classes"> 
     33          description="Compile bedework deployutil classes"> 
    3434    <!-- ==================== Sources and classes ====================== --> 
    3535 
  • 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 in 
    8    all copies and supporting documentation; 
    9  
    10    The name, identifiers, and trademarks of the University of Washington 
    11    are not used in advertising or publicity without the express prior 
    12    written permission of the University of Washington; 
    13  
    14    Recipients acknowledge that this distribution is made available as a 
    15    research courtesy, "as is", potentially with defects, without 
    16    any obligation on the part of the University of Washington to 
    17    provide support, services, or repair; 
    18  
    19    THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR 
    20    IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION 
    21    ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
    22    PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF 
    23    WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
    24    DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 
    25    PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING 
    26    NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH 
    27    THE USE OR PERFORMANCE OF THIS SOFTWARE. 
    28  */ 
    291/* ********************************************************************** 
    30     Copyright 2005 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
     2    Copyright 2010 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
    313 
    324    Redistribution and use of this distribution in source and binary forms, 
     
    5426package org.bedework.deployment; 
    5527 
     28import org.apache.tools.ant.BuildException; 
     29import org.apache.tools.ant.DirectoryScanner; 
     30import org.apache.tools.ant.taskdefs.MatchingTask; 
     31import org.apache.tools.ant.types.FileSet; 
     32import org.apache.tools.ant.util.FileUtils; 
     33 
    5634import java.io.File; 
    5735import java.io.FileInputStream; 
     
    6240import java.util.List; 
    6341import 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; 
    7042 
    7143/** Ant task to build the application.xml file for a ear. 
     
    10476   * @param set 
    10577   */ 
    106   public void addFileset(FileSet set) { 
     78  public void addFileset(final FileSet set) { 
    10779    filesets.add(set); 
    10880  } 
     
    11284   * @param val   String 
    11385   */ 
    114   public void setDisplayName(String val) { 
     86  public void setDisplayName(final String val) { 
    11587    displayName = val; 
    11688  } 
     
    12092   * @param val   String 
    12193   */ 
    122   public void setContexts(String val) { 
     94  public void setContexts(final String val) { 
    12395    contexts = val; 
    12496  } 
     
    128100   * @param val   File 
    129101   */ 
    130   public void setOutFile(File val) { 
     102  public void setOutFile(final File val) { 
    131103    outFile = val; 
    132104  } 
     
    136108   * @param val   File 
    137109   */ 
    138   public void setWarDir(File val) { 
     110  public void setWarDir(final File val) { 
    139111    warDir = val; 
    140112  } 
     
    142114  /** Executes the task 
    143115   */ 
     116  @Override 
    144117  public void execute() throws BuildException { 
    145118    try { 
     
    218191  private void getModules() throws BuildException { 
    219192    FilenameFilter fltr = new FilenameFilter() { 
    220       public boolean accept(File dir, String name) { 
     193      public boolean accept(final File dir, final String name) { 
    221194        return name.endsWith(".war"); 
    222195      } 
     
    249222  } 
    250223 
    251   private void writeLine(String ln) throws Throwable { 
     224  private void writeLine(final String ln) throws Throwable { 
    252225    wtr.write(ln); 
    253226    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 in 
    8    all copies and supporting documentation; 
    9  
    10    The name, identifiers, and trademarks of the University of Washington 
    11    are not used in advertising or publicity without the express prior 
    12    written permission of the University of Washington; 
    13  
    14    Recipients acknowledge that this distribution is made available as a 
    15    research courtesy, "as is", potentially with defects, without 
    16    any obligation on the part of the University of Washington to 
    17    provide support, services, or repair; 
    18  
    19    THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR 
    20    IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION 
    21    ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
    22    PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF 
    23    WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
    24    DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 
    25    PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING 
    26    NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH 
    27    THE USE OR PERFORMANCE OF THIS SOFTWARE. 
    28  */ 
    291/* ********************************************************************** 
    30     Copyright 2005 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
     2    Copyright 2010 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
    313 
    324    Redistribution and use of this distribution in source and binary forms, 
     
    5426package org.bedework.deployment; 
    5527 
     28import org.apache.tools.ant.BuildException; 
     29import org.apache.tools.ant.PropertyHelper; 
     30import org.apache.tools.ant.taskdefs.Sequential; 
     31 
    5632import java.util.Iterator; 
    5733import java.util.LinkedList; 
    5834import java.util.List; 
    5935import 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; 
    6436 
    6537/** Ant task to build the applications based on a list of names 
     
    9870   * @param val   String 
    9971   */ 
    100   public void setNames(String val) { 
     72  public void setNames(final String val) { 
    10173    names = val; 
    10274  } 
     
    10678   * @param val   String 
    10779   */ 
    108   public void setPrefix(String val) { 
     80  public void setPrefix(final String val) { 
    10981    prefix = val; 
    11082  } 
     
    11486   * @param val   String 
    11587   */ 
    116   public void setAppPrefix(String val) { 
     88  public void setAppPrefix(final String val) { 
    11789    appPrefix = val; 
    11890  } 
     
    12294   * @param val   String 
    12395   */ 
    124   public void setProjectPrefix(String val) { 
     96  public void setProjectPrefix(final String val) { 
    12597    projectPrefix = val; 
    12698  } 
     
    128100  /** Execute the task 
    129101   */ 
     102  @Override 
    130103  public void execute() throws BuildException { 
    131104    try { 
     
    214187  /* Turn a comma separated list into a List 
    215188   */ 
    216   private List getList(String val) throws BuildException { 
     189  private List getList(final String val) throws BuildException { 
    217190    List<String> l = new LinkedList<String>(); 
    218191 
  • 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 in 
    8    all copies and supporting documentation; 
    9  
    10    The name, identifiers, and trademarks of the University of Washington 
    11    are not used in advertising or publicity without the express prior 
    12    written permission of the University of Washington; 
    13  
    14    Recipients acknowledge that this distribution is made available as a 
    15    research courtesy, "as is", potentially with defects, without 
    16    any obligation on the part of the University of Washington to 
    17    provide support, services, or repair; 
    18  
    19    THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR 
    20    IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION 
    21    ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
    22    PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF 
    23    WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
    24    DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 
    25    PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING 
    26    NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH 
    27    THE USE OR PERFORMANCE OF THIS SOFTWARE. 
    28  */ 
    291/* ********************************************************************** 
    30     Copyright 2005 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
     2    Copyright 2010 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
    313 
    324    Redistribution and use of this distribution in source and binary forms, 
     
    5426package org.bedework.deployment; 
    5527 
     28import org.apache.tools.ant.BuildException; 
     29import org.apache.tools.ant.PropertyHelper; 
     30import org.apache.tools.ant.Task; 
     31import org.apache.tools.ant.util.FileUtils; 
     32 
    5633import java.io.File; 
    5734import java.io.FileInputStream; 
     
    6643import java.util.TreeMap; 
    6744import 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; 
    7345 
    7446/** Ant task to build the xsl parameters used by the stylesheets for language 
     
    10779   * @param val   File 
    10880   */ 
    109   public void setDir(File val) { 
     81  public void setDir(final File val) { 
    11082    dir = val; 
    11183  } 
     
    11587   * @param val   File 
    11688   */ 
    117   public void setResdir(File val) { 
     89  public void setResdir(final File val) { 
    11890    resdir = val; 
    11991  } 
     
    12395   * @param val   File 
    12496   */ 
    125   public void setXsldir(File val) { 
     97  public void setXsldir(final File val) { 
    12698    xsldir = val; 
    12799  } 
     
    131103   * @param val   String 
    132104   */ 
    133   public void setPrefix(String val) { 
     105  public void setPrefix(final String val) { 
    134106    prefix = val; 
    135107    adjustedPrefix = prefix + "_"; 
     
    140112   * @param val property name 
    141113   */ 
    142   public void setName(String val) { 
     114  public void setName(final String val) { 
    143115      name = val; 
    144116  } 
     
    154126   * @param val   true for checking 
    155127   */ 
    156   public void setCheck(boolean val) { 
     128  public void setCheck(final boolean val) { 
    157129      check = val; 
    158130  } 
     
    160132  /** Execute the task 
    161133   */ 
     134  @Override 
    162135  public void execute() throws BuildException { 
    163136    try { 
     
    221194 
    222195    FilenameFilter fltr = new FilenameFilter() { 
    223       public boolean accept(File dir, String name) { 
     196      public boolean accept(final File dir, final String name) { 
    224197        return name.startsWith(adjustedPrefix) && 
    225198               name.endsWith(suffix); 
     
    238211    } 
    239212 
    240     if (check && fnames.size() > 1) { 
     213    if (check && (fnames.size() > 1)) { 
    241214      checkResources(fnames); 
    242215    } 
     
    245218  } 
    246219 
    247   private void makeXsl(String fname) throws BuildException { 
     220  private void makeXsl(final String fname) throws BuildException { 
    248221    try { 
    249222      String locale = makeLocale(fname); 
     
    276249  } 
    277250 
    278   private String formatLine(String key) { 
     251  private String formatLine(final String key) { 
    279252    return String.format("  <xsl:param name=\"%s\" />", key); 
    280253  } 
    281254 
    282   private void xslLine(String ln) throws Throwable { 
     255  private void xslLine(final String ln) throws Throwable { 
    283256    wtr.write(ln); 
    284257    wtr.write("\n"); 
    285258  } 
    286259 
    287   private String makeLocale(String fname) { 
     260  private String makeLocale(final String fname) { 
    288261    String s = fname.substring(adjustedPrefix.length()); 
    289262 
     
    299272    boolean[] flags; 
    300273 
    301     int first(boolean val) { 
     274    int first(final boolean val) { 
    302275      for (int i = 0; i < flags.length; i++) { 
    303276        if (flags[i] == val) { 
     
    310283  } 
    311284 
    312   private Properties getProps(String fname) throws BuildException { 
     285  private Properties getProps(final String fname) throws BuildException { 
    313286    try { 
    314287      FileInputStream propFile = new FileInputStream(dir.getAbsolutePath() + 
     
    323296  } 
    324297 
    325   private void checkResources(List<String> fnames) throws BuildException { 
     298  private void checkResources(final List<String> fnames) throws BuildException { 
    326299    List<TreeSet<String>> propNamesList = new LinkedList<TreeSet<String>>(); 
    327300    int fnamesSz = fnames.size(); 
     
    389362  } 
    390363 
    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 { 
    395368    for (String name: propNames) { 
    396369      FnameMapEntry fme = nameMap.get(name); 
     
    407380  } 
    408381 
    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) { 
    411384    for (int j = 0; j < propNamesList.size(); j++) { 
    412385      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 in 
    8    all copies and supporting documentation; 
    9  
    10    The name, identifiers, and trademarks of the University of Washington 
    11    are not used in advertising or publicity without the express prior 
    12    written permission of the University of Washington; 
    13  
    14    Recipients acknowledge that this distribution is made available as a 
    15    research courtesy, "as is", potentially with defects, without 
    16    any obligation on the part of the University of Washington to 
    17    provide support, services, or repair; 
    18  
    19    THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR 
    20    IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION 
    21    ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
    22    PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF 
    23    WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
    24    DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 
    25    PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING 
    26    NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH 
    27    THE USE OR PERFORMANCE OF THIS SOFTWARE. 
    28  */ 
    291/* ********************************************************************** 
    30     Copyright 2005 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
     2    Copyright 2010 Rensselaer Polytechnic Institute. All worldwide rights reserved. 
    313 
    324    Redistribution and use of this distribution in source and binary forms, 
     
    5426package org.bedework.deployment; 
    5527 
    56 import java.io.File; 
    57  
    5828import org.apache.tools.ant.BuildException; 
    5929import org.apache.tools.ant.PropertyHelper; 
    6030import org.apache.tools.ant.Task; 
    6131import org.apache.tools.ant.util.FileUtils; 
     32 
     33import java.io.File; 
    6234 
    6335/** Ant task to resolve a file name. This is just a wrapper to the ant FileUtils 
     
    8658   * @param name property name 
    8759   */ 
    88   public void setName(String name) { 
     60  public void setName(final String name) { 
    8961      this.name = name; 
    9062  } 
     
    10274   * @param val filename 
    10375   */ 
    104   public void setBase(File val) { 
     76  public void setBase(final File val) { 
    10577      base = val; 
    10678  } 
     
    11991   * @ant.attribute group="noname" 
    12092   */ 
    121   public void setFile(String val) { 
     93  public void setFile(final String val) { 
    12294      file = new File(val); 
    12395  } 
     
    12597  /** Execute the task 
    12698   */ 
     99  @Override 
    127100  public void execute() throws BuildException { 
    128101    try {