Class TarXzCompressedBinaryManager

java.lang.Object
de.softwareforge.testing.postgres.embedded.TarXzCompressedBinaryManager
All Implemented Interfaces:
NativeBinaryManager

public final class TarXzCompressedBinaryManager extends Object implements NativeBinaryManager
Loads a native binary installation and returns the location of it.
Since:
3.0
  • Constructor Details

    • TarXzCompressedBinaryManager

      public TarXzCompressedBinaryManager(@NonNull NativeBinaryLocator nativeBinaryLocator)
      Creates a new binary manager for tar-xz compressed archives.

      The implementation of NativeBinaryLocator to locate the stream that gets unpacked must satisfy the following criteria:

      Parameters:
      nativeBinaryLocator - An implementation of NativeBinaryLocator that satisfies the conditions above. Must not be null.
  • Method Details

    • setInstallationBaseDirectory

      public void setInstallationBaseDirectory(File installationBaseDirectory)
      Description copied from interface: NativeBinaryManager
      Sets the installation directory. This method must be called before the first call to NativeBinaryManager.getLocation().

      Implementing this method is optional if no local installation directory is required.

      Specified by:
      setInstallationBaseDirectory in interface NativeBinaryManager
      Parameters:
      installationBaseDirectory - Base directory in which the binary distribution is unpacked. Must not be null.
    • setLockFileName

      public void setLockFileName(String lockFileName)
      Sets the lock file name. This method must be called before the first call to getLocation().
      Parameters:
      lockFileName - Name of a file to use as file lock when unpacking the distribution.
    • getLocation

      @NonNull public File getLocation() throws IOException
      Description copied from interface: NativeBinaryManager
      Returns the location (installation directory) for the installed binary.
      Specified by:
      getLocation in interface NativeBinaryManager
      Returns:
      Installation directory with the native binary installed.
      Throws:
      IOException - If the binary could not be located or installed.