View Javadoc

    1   //========================================================================
    2   //$Id: ScanTargetPattern.java 1888 2007-05-31 08:57:33Z janb $
    3   //Copyright 2006 Mort Bay Consulting Pty. Ltd.
    4   //------------------------------------------------------------------------
    5   //Licensed under the Apache License, Version 2.0 (the "License");
    6   //you may not use this file except in compliance with the License.
    7   //You may obtain a copy of the License at
    8   //http://www.apache.org/licenses/LICENSE-2.0
    9   //Unless required by applicable law or agreed to in writing, software
    10  //distributed under the License is distributed on an "AS IS" BASIS,
    11  //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  //See the License for the specific language governing permissions and
    13  //limitations under the License.
    14  //========================================================================
    15
    16  package org.mortbay.jetty.plugin.util;
    17
    18  import java.io.File;
    19  import java.util.Collections;
    20  import java.util.List;
    21
    22  /**
    23   * ScanTargetPattern
    24   *
    25   * Utility class to provide the ability for the mvn jetty:run
    26   * mojo to be able to specify filesets of extra files to
    27   * regularly scan for changes in order to redeploy the webapp.
    28   *
    29   * For example:
    30   *
    31   * &lt;scanTargetPattern&gt;
    32   *   &lt;directory&gt;/some/place&lt;/directory&gt;
    33   *   &lt;includes&gt;
    34   *     &lt;include&gt;some ant pattern here &lt;/include&gt;
    35   *     &lt;include&gt;some ant pattern here &lt;/include&gt;
    36   *   &lt;/includes&gt;
    37   *   &lt;excludes&gt;
    38   *     &lt;exclude&gt;some ant pattern here &lt;/exclude&gt;
    39   *     &lt;exclude&gt;some ant pattern here &lt;/exclude&gt;
    40   *   &lt;/excludes&gt;
    41   * &lt;/scanTargetPattern&gt;
    42   */
    43  public class ScanTargetPattern
    44  {
    45      private File _directory;
    46      private List _includes = Collections.EMPTY_LIST;
    47      private List _excludes = Collections.EMPTY_LIST;
    48
    49      /**
    50       * @return the _directory
    51       */
    52      public File getDirectory()
    53      {
    54          return _directory;
    55      }
    56
    57      /**
    58       * @param _directory the _directory to set
    59       */
    60      public void setDirectory(File directory)
    61      {
    62          this._directory = directory;
    63      }
    64
    65      public void setIncludes (List includes)
    66      {
    67          _includes= includes;
    68      }
    69
    70      public void setExcludes(List excludes)
    71      {
    72          _excludes = excludes;
    73      }
    74
    75      public List getIncludes()
    76      {
    77          return _includes;
    78      }
    79
    80      public List getExcludes()
    81      {
    82          return _excludes;
    83      }
    84
    85  }