View Javadoc

1   /**
2    * Copyright 2010-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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  package org.kuali.common.util.spring;
17  
18  import java.io.File;
19  
20  import org.kuali.common.util.execute.ConvertTableListingTextFileExecutable;
21  import org.springframework.beans.factory.annotation.Autowired;
22  import org.springframework.context.annotation.Bean;
23  import org.springframework.context.annotation.Configuration;
24  import org.springframework.core.env.Environment;
25  
26  @Configuration
27  public class ConvertTableListingTextFileConfig {
28  
29  	@Autowired
30  	Environment env;
31  
32  	@Bean
33  	public ConvertTableListingTextFileExecutable convertTableListingTextFileExecutable() {
34  
35  		String artifactId = SpringUtils.getProperty(env, "impex.txt.artifactId");
36  		File outputDir = SpringUtils.getFile(env, "project.build.outputDirectory");
37  		boolean skip = SpringUtils.getBoolean(env, "impex.txt.skip", false);
38  
39  		ConvertTableListingTextFileExecutable e = new ConvertTableListingTextFileExecutable();
40  		e.setArtifactId(artifactId);
41  		e.setOutputDir(outputDir);
42  		e.setSkip(skip);
43  		return e;
44  	}
45  
46  }