Class ZonkyIOPostgresLocator

java.lang.Object
de.softwareforge.testing.postgres.embedded.ZonkyIOPostgresLocator
All Implemented Interfaces:
NativeBinaryLocator

public final class ZonkyIOPostgresLocator extends Object implements NativeBinaryLocator
Resolves PostgreSQL archives from the Maven repository. Looks for the zonky.io artifacts located at io.zonky.test.postgres:embedded-postgres-binaries-<os>-<arch>.

See The Zonky IO github page for more details.

Since:
3.0
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Method Details

    • getInputStream

      public InputStream getInputStream() throws IOException
      Description copied from interface: NativeBinaryLocator
      Returns an input stream from which the contents of the binary archive can be read.
      Specified by:
      getInputStream in interface NativeBinaryLocator
      Returns:
      An input stream. May return null.
      Throws:
      IOException - If the archive could not be located or read.
    • getIdentifier

      public String getIdentifier() throws IOException
      Description copied from interface: NativeBinaryLocator
      Returns a string identifier that represents the archive returned. This identifier should be stable (same value for the same archive), even across multiple JVM invocations. The value must only contain characters that can be used as a legal file name.

      The default implementation needs to read the full archive contents and is relatively slow. Implementations of this interface can override this method to provide a faster way to create a stable identifier based on the specific implementation.

      The default implementation hashes the archive contents and uses it to return a stable file name.

      Specified by:
      getIdentifier in interface NativeBinaryLocator
      Returns:
      A stable indentifier that can be used as a file name.
      Throws:
      IOException - If the stream could not be read.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object