1 /* 2 * Licensed under the Apache License, Version 2.0 (the "License"); 3 * you may not use this file except in compliance with the License. 4 * You may obtain a copy of the License at 5 * 6 * http://www.apache.org/licenses/LICENSE-2.0 7 * 8 * Unless required by applicable law or agreed to in writing, software 9 * distributed under the License is distributed on an "AS IS" BASIS, 10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 * See the License for the specific language governing permissions and 12 * limitations under the License. 13 */ 14 package de.softwareforge.testing.postgres.embedded; 15 16 import java.io.File; 17 import java.io.IOException; 18 19 import edu.umd.cs.findbugs.annotations.NonNull; 20 21 /** 22 * Returns an installation location for a native binary. The implementation is responsible for locating and optionally unpacking installing the binary. 23 */ 24 @FunctionalInterface 25 public interface NativeBinaryManager { 26 27 /** 28 * Returns the location (installation directory) for the installed binary. 29 * 30 * @return Installation directory with the native binary installed. 31 * @throws IOException If the binary could not be located or installed. 32 */ 33 @NonNull 34 File getLocation() throws IOException; 35 36 /** 37 * Sets the installation directory. This method must be called before the first call to {@link NativeBinaryManager#getLocation()}. 38 * <p> 39 * Implementing this method is optional if no local installation directory is required. 40 * 41 * @param installationBaseDirectory Base directory in which the binary distribution is unpacked. Must not be null. 42 */ 43 default void setInstallationBaseDirectory(File installationBaseDirectory) { 44 } 45 }