View Javadoc
1   /*
2    * (C) Copyright 2006-2014 Nuxeo SA (http://nuxeo.com/) and contributors.
3    *
4    * All rights reserved. This program and the accompanying materials
5    * are made available under the terms of the GNU Lesser General Public License
6    * (LGPL) version 2.1 which accompanies this distribution, and is available at
7    * http://www.gnu.org/licenses/lgpl-2.1.html
8    *
9    * This library is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   * Lesser General Public License for more details.
13   *
14   * Contributors:
15   *     bstefanescu, jcarsique
16   */
17  package org.nuxeo.build.ant.artifact;
18  
19  /**
20   * TODO NXBT-258
21   */
22  public class Expand extends FiltersCollection {
23  
24      public int depth = Integer.MAX_VALUE;
25  
26      public void setDepth(String expand) {
27          depth = readExpand(expand);
28      }
29  
30      public static int readExpand(String expand) {
31          int exp;
32          if ("all".equals(expand) || "true".equals(expand)) {
33              exp = Integer.MAX_VALUE;
34          } else if ("false".equals(expand)) {
35              exp = 0;
36          } else {
37              exp = Integer.parseInt(expand);
38          }
39          return exp;
40      }
41  
42  }