Clover coverage report - Ant Coverage
Coverage timestamp: Tue Apr 8 2003 20:43:55 EST
file stats: LOC: 662   Methods: 43
NCLOC: 317   Classes: 2
 
 Source file Conditionals Statements Methods TOTAL
JspC.java 41.7% 58.5% 60.5% 54.5%
 1   
 /*
 2   
  * The Apache Software License, Version 1.1
 3   
  *
 4   
  * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
 5   
  * reserved.
 6   
  *
 7   
  * Redistribution and use in source and binary forms, with or without
 8   
  * modification, are permitted provided that the following conditions
 9   
  * are met:
 10   
  *
 11   
  * 1. Redistributions of source code must retain the above copyright
 12   
  *    notice, this list of conditions and the following disclaimer.
 13   
  *
 14   
  * 2. Redistributions in binary form must reproduce the above copyright
 15   
  *    notice, this list of conditions and the following disclaimer in
 16   
  *    the documentation and/or other materials provided with the
 17   
  *    distribution.
 18   
  *
 19   
  * 3. The end-user documentation included with the redistribution, if
 20   
  *    any, must include the following acknowlegement:
 21   
  *       "This product includes software developed by the
 22   
  *        Apache Software Foundation (http://www.apache.org/)."
 23   
  *    Alternately, this acknowlegement may appear in the software itself,
 24   
  *    if and wherever such third-party acknowlegements normally appear.
 25   
  *
 26   
  * 4. The names "Ant" and "Apache Software
 27   
  *    Foundation" must not be used to endorse or promote products derived
 28   
  *    from this software without prior written permission. For written
 29   
  *    permission, please contact apache@apache.org.
 30   
  *
 31   
  * 5. Products derived from this software may not be called "Apache"
 32   
  *    nor may "Apache" appear in their names without prior written
 33   
  *    permission of the Apache Group.
 34   
  *
 35   
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 36   
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 37   
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 38   
  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 39   
  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 40   
  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 41   
  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 42   
  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 43   
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 44   
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 45   
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 46   
  * SUCH DAMAGE.
 47   
  * ====================================================================
 48   
  *
 49   
  * This software consists of voluntary contributions made by many
 50   
  * individuals on behalf of the Apache Software Foundation.  For more
 51   
  * information on the Apache Software Foundation, please see
 52   
  * <http://www.apache.org/>.
 53   
  */
 54   
 
 55   
 package org.apache.tools.ant.taskdefs.optional.jsp;
 56   
 
 57   
 import java.io.File;
 58   
 import java.util.Date;
 59   
 import java.util.Enumeration;
 60   
 import java.util.Vector;
 61   
 import org.apache.tools.ant.AntClassLoader;
 62   
 import org.apache.tools.ant.BuildException;
 63   
 import org.apache.tools.ant.DirectoryScanner;
 64   
 import org.apache.tools.ant.Project;
 65   
 import org.apache.tools.ant.taskdefs.MatchingTask;
 66   
 import org.apache.tools.ant.taskdefs.optional.jsp.compilers.JspCompilerAdapter;
 67   
 import org.apache.tools.ant.taskdefs.optional.jsp.compilers.JspCompilerAdapterFactory;
 68   
 import org.apache.tools.ant.types.Path;
 69   
 import org.apache.tools.ant.types.Reference;
 70   
 
 71   
 /**
 72   
  * Runs a JSP compiler.
 73   
  *
 74   
  * <p> This task takes the given jsp files and compiles them into java
 75   
  * files. It is then up to the user to compile the java files into classes.
 76   
  *
 77   
  * <p> The task requires the srcdir and destdir attributes to be
 78   
  * set. This Task is a MatchingTask, so the files to be compiled can be
 79   
  * specified using includes/excludes attributes or nested include/exclude
 80   
  * elements. Optional attributes are verbose (set the verbosity level passed
 81   
  * to jasper), package (name of the destination package for generated java
 82   
  * classes and classpath (the classpath to use when running the jsp
 83   
  * compiler).
 84   
  * <p> This task supports the nested elements classpath (A Path) and
 85   
  * classpathref (A Reference) which can be used in preference to the
 86   
  * attribute classpath, if the jsp compiler is not already in the ant
 87   
  * classpath.
 88   
  *
 89   
  * <p><h4>Usage</h4>
 90   
  * <pre>
 91   
  * &lt;jspc srcdir="${basedir}/src/war"
 92   
  *       destdir="${basedir}/gensrc"
 93   
  *       package="com.i3sp.jsp"
 94   
  *       verbose="9"&gt;
 95   
  *   &lt;include name="**\/*.jsp" /&gt;
 96   
  * &lt;/jspc&gt;
 97   
  * </pre>
 98   
  *
 99   
  * @author Steve Loughran
 100   
  * @author <a href="mailto:mattw@i3sp.com">Matthew Watson</a>
 101   
  * <p> Large Amount of cutting and pasting from the Javac task...
 102   
  * @author James Davidson <a href="mailto:duncan@x180.com">duncan@x180.com</a>
 103   
  * @author Robin Green <a href="mailto:greenrd@hotmail.com">greenrd@hotmail.com</a>
 104   
  * @author Stefan Bodewig
 105   
  * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
 106   
  * @since 1.5
 107   
  */
 108   
 public class JspC extends MatchingTask {
 109   
     private Path classpath;
 110   
     private Path compilerClasspath;
 111   
     private Path src;
 112   
     private File destDir;
 113   
     private String packageName ;
 114   
     /** name of the compiler to use */
 115   
     private String compilerName = "jasper";
 116   
 
 117   
     /**
 118   
      *  -ieplugin &lt;clsid&gt; Java Plugin classid for Internet Explorer
 119   
      */
 120   
     private String iepluginid ;
 121   
     private boolean mapped ;
 122   
     private int verbose = 0;
 123   
     protected Vector compileList = new Vector();
 124   
     Vector javaFiles = new Vector();
 125   
 
 126   
     /**
 127   
      *  flag to control action on execution trouble
 128   
      */
 129   
     protected boolean failOnError = true;
 130   
 
 131   
     /**
 132   
      *  -uriroot &lt;dir&gt; The root directory that uri files should be resolved
 133   
      *  against,
 134   
      */
 135   
     private File uriroot;
 136   
 
 137   
     /**
 138   
      *  -webinc &lt;file&gt; Creates partial servlet mappings for the -webapp option
 139   
      */
 140   
     private File webinc;
 141   
 
 142   
     /**
 143   
      *  -webxml &lt;file&gt; Creates a complete web.xml when using the -webapp option.
 144   
      */
 145   
 
 146   
     private File webxml;
 147   
 
 148   
     /**
 149   
      *  web apps
 150   
      */
 151   
     protected WebAppParameter webApp;
 152   
 
 153   
 
 154   
 
 155   
     private static final String FAIL_MSG
 156   
         = "Compile failed, messages should have been provided.";
 157   
 
 158   
     /**
 159   
      * Set the path for source JSP files.
 160   
      */
 161  7
     public void setSrcDir(Path srcDir) {
 162  7
         if (src == null) {
 163  7
             src = srcDir;
 164   
         } else {
 165  0
             src.append(srcDir);
 166   
         }
 167   
     }
 168  0
     public Path getSrcDir(){
 169  0
         return src;
 170   
     }
 171   
 
 172   
     /**
 173   
      * Set the destination directory into which the JSP source
 174   
      * files should be compiled.
 175   
      */
 176  7
     public void setDestdir(File destDir) {
 177  7
         this.destDir = destDir;
 178   
     }
 179  6
     public File getDestdir(){
 180  6
         return destDir;
 181   
     }
 182   
 
 183   
     /**
 184   
      * Set the name of the package the compiled jsp files should be in.
 185   
      */
 186  0
     public void setPackage(String pkg){
 187  0
         this.packageName = pkg;
 188   
     }
 189   
 
 190  6
     public String getPackage(){
 191  6
         return packageName;
 192   
     }
 193   
 
 194   
     /**
 195   
      * Set the verbose level of the compiler
 196   
      */
 197  7
     public void setVerbose(int i){
 198  7
         verbose = i;
 199   
     }
 200  6
     public int getVerbose(){
 201  6
         return verbose;
 202   
     }
 203   
 
 204   
     /**
 205   
      * Whether or not the build should halt if compilation fails.
 206   
      * Defaults to <code>true</code>.
 207   
      */
 208  0
     public void setFailonerror(boolean fail) {
 209  0
         failOnError = fail;
 210   
     }
 211   
     /**
 212   
      * Gets the failonerror flag.
 213   
      */
 214  6
     public boolean getFailonerror() {
 215  6
         return failOnError;
 216   
     }
 217   
 
 218  6
     public String getIeplugin() {
 219  6
         return iepluginid;
 220   
     }
 221   
     /**
 222   
      * Java Plugin CLASSID for Internet Explorer
 223   
      */
 224  0
     public void setIeplugin(String iepluginid) {
 225  0
         this.iepluginid = iepluginid;
 226   
     }
 227   
 
 228   
     /**
 229   
      * If true, generate separate write() calls for each HTML line
 230   
      * in the JSP.
 231   
      * @return mapping status
 232   
      */
 233  6
     public boolean isMapped() {
 234  6
         return mapped;
 235   
     }
 236   
 
 237   
     /**
 238   
      * If true, generate separate write() calls for each HTML line
 239   
      * in the JSP.
 240   
      */
 241  0
     public void setMapped(boolean mapped) {
 242  0
         this.mapped = mapped;
 243   
     }
 244   
 
 245   
     /**
 246   
      * The URI context of relative URI references in the JSP pages.
 247   
      * If it does not exist then it is derived from the location
 248   
      * of the file relative to the declared or derived value of uriroot.
 249   
      *
 250   
      * @param  uribase  The new Uribase value
 251   
      */
 252  0
     public void setUribase(File uribase) {
 253  0
         log( "Uribase is currently an unused parameter", Project.MSG_WARN);
 254   
     }
 255   
 
 256  6
     public File getUribase() {
 257  6
         return uriroot;
 258   
     }
 259   
 
 260   
     /**
 261   
      *  The root directory that uri files should be resolved
 262   
      *  against. (Default is the directory jspc is invoked from)
 263   
      *
 264   
      * @param  uriroot  The new Uribase value
 265   
      */
 266  2
     public void setUriroot(File uriroot) {
 267  2
         this.uriroot = uriroot;
 268   
     }
 269   
 
 270  6
     public File getUriroot() {
 271  6
         return uriroot;
 272   
     }
 273   
 
 274   
 
 275   
     /**
 276   
      * Set the classpath to be used for this compilation.
 277   
      */
 278  0
     public void setClasspath(Path cp) {
 279  0
         if (classpath == null) {
 280  0
             classpath = cp;
 281   
         } else {
 282  0
             classpath.append(cp);
 283   
         }
 284   
     }
 285   
 
 286   
     /**
 287   
      * Adds a path to the classpath.
 288   
      */
 289  0
     public Path createClasspath() {
 290  0
         if (classpath == null) {
 291  0
             classpath = new Path(getProject());
 292   
         }
 293  0
         return classpath.createPath();
 294   
     }
 295   
 
 296   
     /**
 297   
      * Adds a reference to a classpath defined elsewhere
 298   
      */
 299  0
     public void setClasspathRef(Reference r) {
 300  0
         createClasspath().setRefid(r);
 301   
     }
 302  6
     public Path getClasspath(){
 303  6
         return classpath;
 304   
     }
 305   
 
 306   
     /**
 307   
      * Set the classpath to be used to find this compiler adapter
 308   
      */
 309  0
     public void setCompilerclasspath(Path cp) {
 310  0
         if (compilerClasspath == null) {
 311  0
             compilerClasspath = cp;
 312   
         } else {
 313  0
             compilerClasspath.append(cp);
 314   
         }
 315   
     }
 316   
 
 317   
     /**
 318   
      * get the classpath used to find the compiler adapter
 319   
      */
 320  0
     public Path getCompilerclasspath(){
 321  0
         return compilerClasspath;
 322   
     }
 323   
 
 324   
     /**
 325   
      * Support nested compiler classpath, used to locate compiler adapter
 326   
      */
 327  0
     public Path createCompilerclasspath() {
 328  0
         if (compilerClasspath == null) {
 329  0
             compilerClasspath = new Path(getProject());
 330   
         }
 331  0
         return compilerClasspath.createPath();
 332   
     }
 333   
 
 334   
     /**
 335   
      *  Filename for web.xml.
 336   
      *
 337   
      * @param  webxml  The new Webxml value
 338   
      */
 339  0
     public void setWebxml(File webxml) {
 340  0
         this.webxml = webxml;
 341   
     }
 342   
 
 343   
     /**
 344   
      * Filename for web.xml.
 345   
      * @return
 346   
      */
 347  6
     public File getWebxml() {
 348  6
         return this.webxml;
 349   
     }
 350   
 
 351   
     /**
 352   
      *  output filename for the fraction of web.xml that lists
 353   
      *  servlets.
 354   
      * @param  webinc  The new Webinc value
 355   
      */
 356  0
     public void setWebinc(File webinc) {
 357  0
         this.webinc = webinc;
 358   
     }
 359   
 
 360  6
     public File getWebinc() {
 361  6
         return this.webinc;
 362   
     }
 363   
 
 364   
     /**
 365   
      * Adds a single webapp.
 366   
      *
 367   
      * @param  webappParam  add a web app parameter
 368   
      */
 369  0
     public void addWebApp(WebAppParameter webappParam)
 370   
         throws BuildException {
 371   
         //demand create vector of filesets
 372  0
         if (webApp == null) {
 373  0
             webApp = webappParam;
 374   
         } else {
 375  0
             throw new BuildException("Only one webapp can be specified");
 376   
         }
 377   
     }
 378   
 
 379  6
     public WebAppParameter getWebApp() {
 380  6
         return webApp;
 381   
     }
 382   
 
 383   
     /**
 384   
      * Class name of a JSP compiler adapter.
 385   
      */
 386  6
     public void setCompiler(String compiler) {
 387  6
         this.compilerName = compiler;
 388   
     }
 389   
 
 390   
     /**
 391   
     * get the list of files to compile
 392   
     */
 393  6
     public Vector getCompileList(){
 394  6
         return compileList;
 395   
     }
 396   
 
 397   
     /**
 398   
      * execute by building up a list of files that
 399   
      * have changed and hand them off to a jsp compiler
 400   
      */
 401  7
     public void execute()
 402   
         throws BuildException {
 403   
 
 404   
         // make sure that we've got a destdir
 405  7
         if (destDir == null) {
 406  0
             throw new BuildException("destdir attribute must be set!",
 407   
                                      getLocation());
 408   
         }
 409   
 
 410  7
         if (!destDir.isDirectory()) {
 411  0
             throw new
 412   
                 BuildException("destination directory \"" + destDir +
 413   
                                "\" does not exist or is not a directory",
 414   
                                getLocation());
 415   
         }
 416   
 
 417  7
         File dest = getActualDestDir();
 418   
 
 419   
         //bind to a compiler
 420  7
         JspCompilerAdapter compiler =
 421   
             JspCompilerAdapterFactory.getCompiler(compilerName, this,
 422   
                 getProject().createClassLoader(compilerClasspath));
 423   
 
 424   
         //if we are a webapp, hand off to the compiler, which had better handle it
 425  7
         if(webApp!=null) {
 426  0
             doCompilation(compiler);
 427  0
             return;
 428   
         }
 429   
 
 430   
         // make sure that we've got a srcdir
 431  7
         if (src == null) {
 432  0
             throw new BuildException("srcdir attribute must be set!",
 433   
                                      getLocation());
 434   
         } 
 435  7
         String [] list = src.list();
 436  7
         if (list.length == 0) {
 437  0
             throw new BuildException("srcdir attribute must be set!",
 438   
                     getLocation());
 439   
         }
 440   
 
 441   
 
 442   
         // if the compiler does its own dependency stuff, we just call it right now
 443  7
         if (compiler.implementsOwnDependencyChecking()) {
 444  0
             doCompilation(compiler);
 445  0
             return;
 446   
         }
 447   
 
 448   
         //the remainder of this method is only for compilers that need their dependency work done
 449  7
         JspMangler mangler = compiler.createMangler();
 450   
 
 451   
         // scan source directories and dest directory to build up both copy
 452   
         // lists and compile lists
 453  7
         resetFileLists();
 454  7
         int filecount = 0;
 455  7
         for (int i = 0; i < list.length; i++) {
 456  7
             File srcDir = getProject().resolveFile(list[i]);
 457  7
             if (!srcDir.exists()) {
 458  0
                 throw new BuildException("srcdir \"" + srcDir.getPath() +
 459   
                                          "\" does not exist!", getLocation());
 460   
             }
 461  7
             DirectoryScanner ds = this.getDirectoryScanner(srcDir);
 462  7
             String[] files = ds.getIncludedFiles();
 463  7
             filecount = files.length;
 464  7
             scanDir(srcDir, dest, mangler, files);
 465   
         }
 466   
 
 467   
         // compile the source files
 468   
 
 469  7
         log("compiling " + compileList.size() + " files", Project.MSG_VERBOSE);
 470   
 
 471  7
         if (compileList.size() > 0) {
 472   
 
 473  6
             log("Compiling " + compileList.size() +
 474   
                 " source file"
 475   
                 + (compileList.size() == 1 ? "" : "s")
 476   
                 + dest);
 477  6
             doCompilation(compiler);
 478   
 
 479   
         } else {
 480  1
             if (filecount == 0) {
 481  1
                 log("there were no files to compile", Project.MSG_INFO);
 482   
             } else {
 483  0
                 log("all files are up to date", Project.MSG_VERBOSE);
 484   
             }
 485   
         }
 486   
     }
 487   
 
 488   
     /**
 489   
      * calculate where the files will end up:
 490   
      * this is destDir or it id destDir + the package name
 491   
      */
 492  7
     private File getActualDestDir() {
 493  7
         File dest = null;
 494  7
         if (packageName == null) {
 495  7
             dest = destDir;
 496   
         } else {
 497  0
             String path = destDir.getPath() + File.separatorChar +
 498   
                 packageName.replace('.', File.separatorChar);
 499  0
             dest = new File(path);
 500   
         }
 501  7
         return dest;
 502   
     }
 503   
 
 504   
     /**
 505   
      * do the compile
 506   
      */
 507  6
     private void doCompilation(JspCompilerAdapter compiler)
 508   
             throws BuildException {
 509   
         // now we need to populate the compiler adapter
 510  6
         compiler.setJspc(this);
 511   
 
 512   
         // finally, lets execute the compiler!!
 513  0
         if (!compiler.execute()) {
 514  0
             if (failOnError) {
 515  0
                 throw new BuildException(FAIL_MSG, getLocation());
 516   
             } else {
 517  0
                 log(FAIL_MSG, Project.MSG_ERR);
 518   
             }
 519   
         }
 520   
     }
 521   
 
 522   
     /**
 523   
      * Clear the list of files to be compiled and copied..
 524   
      */
 525  7
     protected void resetFileLists() {
 526  7
         compileList.removeAllElements();
 527   
     }
 528   
 
 529   
     /**
 530   
      * Scans the directory looking for source files to be compiled.
 531   
      * The results are returned in the class variable compileList
 532   
      */
 533  7
     protected void scanDir(File srcDir, File dest, JspMangler mangler, String files[]) {
 534   
 
 535  7
         long now = (new Date()).getTime();
 536   
 
 537  7
         for (int i = 0; i < files.length; i++) {
 538  6
             String filename = files[i];
 539  6
             File srcFile = new File(srcDir, filename);
 540  6
             File javaFile = mapToJavaFile(mangler, srcFile, srcDir, dest);
 541  6
             if(javaFile==null) {
 542  0
                 continue;
 543   
             }
 544   
 
 545  6
             if (srcFile.lastModified() > now) {
 546  0
                 log("Warning: file modified in the future: " + filename,
 547   
                         Project.MSG_WARN);
 548   
             }
 549  6
             boolean shouldCompile = false;
 550  6
             shouldCompile = isCompileNeeded(srcFile, javaFile);
 551  6
             if (shouldCompile) {
 552  6
                compileList.addElement(srcFile.getAbsolutePath());
 553  6
                javaFiles.addElement(javaFile);
 554   
             }
 555   
         }
 556   
     }
 557   
 
 558   
     /**
 559   
      * Test whether or not compilation is needed. A return value of
 560   
      * <code>true<code> means yes, <code>false</code> means
 561   
      * our tests do not indicate this, but as the TLDs are
 562   
      * not used for dependency checking this is not guaranteed.
 563   
      * The current tests are
 564   
      * <ol>
 565   
      * <li>no dest file
 566   
      * <li>dest file out of date w.r.t source
 567   
      * <li>dest file zero bytes long
 568   
      * </ol>
 569   
      * @param srcFile JSP source file
 570   
      * @param javaFile JSP dest file
 571   
      * @return true if a compile is definately needed.
 572   
      *
 573   
      */
 574  6
     private boolean isCompileNeeded(File srcFile, File javaFile) {
 575  6
         boolean shouldCompile = false;
 576  6
         if (!javaFile.exists()) {
 577  6
             shouldCompile = true;
 578  6
             log("Compiling " + srcFile.getPath()
 579   
                 + " because java file " + javaFile.getPath()
 580   
                 + " does not exist", Project.MSG_VERBOSE);
 581   
             } else {
 582  0
                 if (srcFile.lastModified() > javaFile.lastModified()) {
 583  0
                     shouldCompile = true;
 584  0
                     log("Compiling " + srcFile.getPath()
 585   
                         + " because it is out of date with respect to "
 586   
                         + javaFile.getPath(),
 587   
                         Project.MSG_VERBOSE);
 588   
                 } else {
 589  0
                     if (javaFile.length() == 0) {
 590  0
                         shouldCompile = true;
 591  0
                         log("Compiling " + srcFile.getPath()
 592   
                             + " because java file " + javaFile.getPath()
 593   
                             + " is empty", Project.MSG_VERBOSE);
 594   
                     }
 595   
                 }
 596   
         }
 597  6
         return shouldCompile;
 598   
     }
 599   
 
 600   
 
 601   
     /**
 602   
      * get a filename from our jsp file
 603   
      * @todo support packages and subdirs
 604   
      */
 605  6
     protected File mapToJavaFile(JspMangler mangler, File srcFile, File srcDir, File dest) {
 606  6
         if (!srcFile.getName().endsWith(".jsp")) {
 607  0
             return null;
 608   
         }
 609  6
         String javaFileName = mangler.mapJspToJavaName(srcFile);
 610   
 //        String srcFileDir=srcFile.getParent();
 611  6
         return new File(dest, javaFileName);
 612   
     }
 613   
 
 614   
     /**
 615   
      * delete any java output files that are empty
 616   
      * this is to get around a little defect in jasper: when it
 617   
      * fails, it leaves incomplete files around.
 618   
      */
 619  6
     public void deleteEmptyJavaFiles() {
 620  6
         if (javaFiles != null) {
 621  6
             Enumeration enum = javaFiles.elements();
 622  6
             while (enum.hasMoreElements()) {
 623  6
                 File file = (File) enum.nextElement();
 624  6
                 if (file.exists() && file.length() == 0) {
 625  0
                     log("deleting empty output file " + file);
 626  0
                     file.delete();
 627   
                 }
 628   
             }
 629   
         }
 630   
     }
 631   
 
 632   
     /**
 633   
      * static inner class used as a parameter element
 634   
      */
 635   
     public static class WebAppParameter {
 636   
 
 637   
         /**
 638   
          * the sole option
 639   
          */
 640   
         private File directory;
 641   
 
 642   
         /**
 643   
          * query current directory
 644   
          */
 645   
 
 646  0
         public File getDirectory() {
 647  0
             return directory;
 648   
         }
 649   
 
 650   
         /**
 651   
          * set directory; alternate syntax
 652   
          */
 653  0
         public void setBaseDir(File directory) {
 654  0
             this.directory = directory;
 655   
         }
 656   
     //end inner class
 657   
     }
 658   
 
 659   
 
 660   
 //end class
 661   
 }
 662