View Javadoc
1   /*
2    *    Copyright 2010-2022 the original author or authors.
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    *       https://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  package org.apache.ibatis.migration.options;
17  
18  import static org.apache.ibatis.migration.utils.Util.file;
19  
20  import java.io.File;
21  
22  public class SelectedPaths {
23    private File basePath = new File("./");
24    private File envPath;
25    private File scriptPath;
26    private File driverPath;
27    private File hookPath;
28  
29    public File getBasePath() {
30      return basePath;
31    }
32  
33    public File getEnvPath() {
34      return envPath == null ? file(basePath, "./environments") : envPath;
35    }
36  
37    public File getScriptPath() {
38      return scriptPath == null ? file(basePath, "./scripts") : scriptPath;
39    }
40  
41    public File getDriverPath() {
42      return driverPath == null ? file(basePath, "./drivers") : driverPath;
43    }
44  
45    public File getHookPath() {
46      return hookPath == null ? file(basePath, "./hooks") : hookPath;
47    }
48  
49    public void setBasePath(File aBasePath) {
50      basePath = aBasePath;
51    }
52  
53    public void setEnvPath(File aEnvPath) {
54      envPath = aEnvPath;
55    }
56  
57    public void setScriptPath(File aScriptPath) {
58      scriptPath = aScriptPath;
59    }
60  
61    public void setDriverPath(File aDriverPath) {
62      driverPath = aDriverPath;
63    }
64  
65    public void setHookPath(File aHookPath) {
66      hookPath = aHookPath;
67    }
68  }