Class TarXzCompressedBinaryManager
java.lang.Object
de.softwareforge.testing.postgres.embedded.TarXzCompressedBinaryManager
- All Implemented Interfaces:
NativeBinaryManager
Loads a native binary installation and returns the location of it.
- Since:
- 3.0
-
Constructor Summary
ConstructorDescriptionTarXzCompressedBinaryManager
(NativeBinaryLocator nativeBinaryLocator) Creates a new binary manager for tar-xz compressed archives. -
Method Summary
Modifier and TypeMethodDescriptionReturns the location (installation directory) for the installed binary.void
setInstallationBaseDirectory
(File installationBaseDirectory) Sets the installation directory.void
setLockFileName
(String lockFileName) Sets the lock file name.
-
Constructor Details
-
TarXzCompressedBinaryManager
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:- It must override
Object.equals(Object)
andObject.hashCode()
. - It should implement
Object.toString()
to return meaningful information about the locator. - It must allow multiple calls to
NativeBinaryLocator.getInputStream()
which all return the same, byte-identical contents. The operation should be cheap as it may be called multiple times.
- Parameters:
nativeBinaryLocator
- An implementation ofNativeBinaryLocator
that satisfies the conditions above. Must not be null.
- It must override
-
-
Method Details
-
setInstallationBaseDirectory
Description copied from interface:NativeBinaryManager
Sets the installation directory. This method must be called before the first call toNativeBinaryManager.getLocation()
.Implementing this method is optional if no local installation directory is required.
- Specified by:
setInstallationBaseDirectory
in interfaceNativeBinaryManager
- Parameters:
installationBaseDirectory
- Base directory in which the binary distribution is unpacked. Must not be null.
-
setLockFileName
Sets the lock file name. This method must be called before the first call togetLocation()
.- Parameters:
lockFileName
- Name of a file to use as file lock when unpacking the distribution.
-
getLocation
Description copied from interface:NativeBinaryManager
Returns the location (installation directory) for the installed binary.- Specified by:
getLocation
in interfaceNativeBinaryManager
- Returns:
- Installation directory with the native binary installed.
- Throws:
IOException
- If the binary could not be located or installed.
-