View Javadoc

1   /*--------------------------------------------------------------------------
2    *  Copyright 2008 utgenome.org
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   *--------------------------------------------------------------------------*/
16  //--------------------------------------
17  // utgb-shell Project
18  //
19  // Clean.java
20  // Since: May 27, 2008
21  //
22  // $URL$ 
23  // $Author$
24  //--------------------------------------
25  package org.utgenome.shell;
26  
27  import java.io.File;
28  
29  import org.xerial.util.FileUtil;
30  import org.xerial.util.log.Logger;
31  
32  /**
33   * UTGB Shell Sub Command for cleaning target directory
34   * 
35   * @author leo
36   * 
37   */
38  public class Clean extends UTGBShellCommand {
39  
40  	private static Logger _logger = Logger.getLogger(Clean.class);
41  
42  	@Override
43  	public void execute(String[] args) throws Exception {
44  
45  		if (!isInProjectRoot())
46  			throw new UTGBShellException("not in the project root");
47  
48  		// clean war/utgb
49  		_logger.info("clean war/utgb ...");
50  		FileUtil.rmdir(new File(getProjectRoot(), "war/utgb"));
51  
52  		// clean target folder
53  		maven("clean");
54  	}
55  
56  	@Override
57  	public String name() {
58  		return "clean";
59  	}
60  
61  	@Override
62  	public String getOneLinerDescription() {
63  		return "clean the target folder";
64  	}
65  
66  }