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
ConstructorsConstructorDescriptionTarXzCompressedBinaryManager(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.voidsetInstallationBaseDirectory(File installationBaseDirectory) Sets the installation directory.voidsetLockFileName(String lockFileName) Sets the lock file name.
-
Constructor Details
-
TarXzCompressedBinaryManager
Creates a new binary manager for tar-xz compressed archives.The implementation of
NativeBinaryLocatorto 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 ofNativeBinaryLocatorthat satisfies the conditions above. Must not be null.
- It must override
-
-
Method Details
-
setInstallationBaseDirectory
Description copied from interface:NativeBinaryManagerSets 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:
setInstallationBaseDirectoryin 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:NativeBinaryManagerReturns the location (installation directory) for the installed binary.- Specified by:
getLocationin interfaceNativeBinaryManager- Returns:
- Installation directory with the native binary installed.
- Throws:
IOException- If the binary could not be located or installed.
-