Clover coverage report - Ant Coverage
Coverage timestamp: Tue Apr 8 2003 20:43:55 EST
file stats: LOC: 172   Methods: 1
NCLOC: 18   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
VAJExportServlet.java - 0% 0% 0%
 1   
 /*
 2   
  * The Apache Software License, Version 1.1
 3   
  *
 4   
  * Copyright (c) 2001-2002 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.ide;
 56   
 
 57   
 
 58   
 import java.io.File;
 59   
 
 60   
 /**
 61   
  * A Remote Access to Tools Servlet to extract package
 62   
  * sets from the Workbench to the local file system.
 63   
  * The following table describes the servlet parameters.
 64   
  *
 65   
  * <table border="1">
 66   
  *   <tr>
 67   
  *     <td><strong>Parameter</strong></td>
 68   
  *     <td><strong>Values</strong></td>
 69   
  *     <td><strong>Description</strong></td>
 70   
  *   </tr>
 71   
  *   <tr>
 72   
  *     <td>dir</td>
 73   
  *     <td>Any valid directory name on the server.</td>
 74   
  *     <td>The directory to export the files to on the machine 
 75   
  *         where the servlet is being run.  If the directory 
 76   
  *         doesn't exist, it will be created.<p>
 77   
  *         Relative paths are relative to 
 78   
  *         IBMVJava/ide/tools/com-ibm-ivj-toolserver, 
 79   
  *         where IBMVJava is the VisualAge for Java installation 
 80   
  *         directory.</td>
 81   
  *   </tr>
 82   
  *   <tr>
 83   
  *     <td>include</td>
 84   
  *     <td>See below.</td>
 85   
  *     <td>The pattern used to indicate which projects and 
 86   
  *         packages to export.</td>
 87   
  *   </tr>
 88   
  *   <tr>
 89   
  *     <td>exclude</td>
 90   
  *     <td>See below</td>
 91   
  *     <td>The pattern used to indicate which projects and 
 92   
  *         packages <em>not</em> to export.</td>
 93   
  *   </tr>
 94   
  *   <tr>
 95   
  *     <td>cls</td>
 96   
  *     <td>"yes" or "no" (without the quotes)</td>
 97   
  *     <td>Export class files.  Defaults to "no".</td>
 98   
  *   </tr>
 99   
  *   <tr>
 100   
  *     <td>src</td>
 101   
  *     <td>"yes" or "no" (without the quotes)</td>
 102   
  *     <td>Export source files.  Defaults to "yes".</td>
 103   
  *   </tr>
 104   
  *   <tr>
 105   
  *     <td>res</td>
 106   
  *     <td>"yes" or "no" (without the quotes)</td>
 107   
  *     <td>Export resource files associated with the included project(s).
 108   
  *         Defaults to "yes".</td>
 109   
  *   </tr>
 110   
  *   <tr>
 111   
  *     <td>dex</td>
 112   
  *     <td>"yes" or "no" (without the quotes)</td>
 113   
  *     <td>Use the default exclusion patterns.  Defaults to "yes".  
 114   
  *         See below for an explanation of default excludes.</td>
 115   
  *   </tr>
 116   
  *   <tr>
 117   
  *     <td>owr</td>
 118   
  *     <td>"yes" or "no" (without the quotes)</td>
 119   
  *     <td>Overwrite any existing files.  Defaults to "yes".</td>
 120   
  *   </tr>
 121   
  * </table>
 122   
  *
 123   
  * <p>The vajexport servlet uses include and exclude parameters to form 
 124   
  *    the criteria for selecting packages to export. The parameter is 
 125   
  *    broken up into ProjectName/packageNameSegments, where ProjectName 
 126   
  *    is what you expect, and packageNameSegments is a partial (or complete) 
 127   
  *    package name, separated by forward slashes, rather than periods.  
 128   
  *    Each packageNameSegment can have wildcard characters.</p>
 129   
  *
 130   
  * <table border="1">
 131   
  *   <tr>
 132   
  *     <td><strong>Wildcard Characters</strong></td>
 133   
  *     <td><strong>Description</strong></td>
 134   
  *   </tr>
 135   
  *   <tr>
 136   
  *     <td>*</td>
 137   
  *     <td>Match zero or more characters in that segment.</td>
 138   
  *   </tr>
 139   
  *   <tr>
 140   
  *     <td>?</td>
 141   
  *     <td>Match one character in that segment.</td>
 142   
  *   </tr>
 143   
  *   <tr>
 144   
  *     <td>**</td>
 145   
  *     <td>Matches all characters in zero or more segments.</td>
 146   
  *   </tr>
 147   
  * </table>
 148   
  *
 149   
  * @author Wolf Siberski, based on servlets written by Glenn McAllister
 150   
  */
 151   
 public class VAJExportServlet extends VAJToolsServlet {
 152   
     // constants for servlet param names
 153   
     public static final String WITH_DEBUG_INFO = "deb";
 154   
     public static final String OVERWRITE_PARAM = "owr";
 155   
 
 156   
     /**
 157   
      * Respond to a request to export packages from the Workbench.
 158   
      */
 159  0
     protected void executeRequest() {
 160  0
         getUtil().exportPackages(
 161   
                          new File(getFirstParamValueString(DIR_PARAM)),
 162   
                          getParamValues(INCLUDE_PARAM),
 163   
                          getParamValues(EXCLUDE_PARAM),
 164   
                          getBooleanParam(CLASSES_PARAM, false),
 165   
                          getBooleanParam(WITH_DEBUG_INFO, false),
 166   
                          getBooleanParam(RESOURCES_PARAM, true),
 167   
                          getBooleanParam(SOURCES_PARAM, true),
 168   
                          getBooleanParam(DEFAULT_EXCLUDES_PARAM, true),
 169   
                          getBooleanParam(OVERWRITE_PARAM, true));
 170   
     }
 171   
 }
 172