SelectedPaths.java

  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. import static org.apache.ibatis.migration.utils.Util.file;

  18. import java.io.File;

  19. public class SelectedPaths {
  20.   private File basePath = new File("./");
  21.   private File envPath;
  22.   private File scriptPath;
  23.   private File driverPath;
  24.   private File hookPath;

  25.   public File getBasePath() {
  26.     return basePath;
  27.   }

  28.   public File getEnvPath() {
  29.     return envPath == null ? file(basePath, "./environments") : envPath;
  30.   }

  31.   public File getScriptPath() {
  32.     return scriptPath == null ? file(basePath, "./scripts") : scriptPath;
  33.   }

  34.   public File getDriverPath() {
  35.     return driverPath == null ? file(basePath, "./drivers") : driverPath;
  36.   }

  37.   public File getHookPath() {
  38.     return hookPath == null ? file(basePath, "./hooks") : hookPath;
  39.   }

  40.   public void setBasePath(File aBasePath) {
  41.     basePath = aBasePath;
  42.   }

  43.   public void setEnvPath(File aEnvPath) {
  44.     envPath = aEnvPath;
  45.   }

  46.   public void setScriptPath(File aScriptPath) {
  47.     scriptPath = aScriptPath;
  48.   }

  49.   public void setDriverPath(File aDriverPath) {
  50.     driverPath = aDriverPath;
  51.   }

  52.   public void setHookPath(File aHookPath) {
  53.     hookPath = aHookPath;
  54.   }
  55. }