Class PgPassUtilities
java.lang.Object
org.noise_planet.noisemodelling.webserver.utilities.PgPassUtilities
Utility class to handle PostgreSQL .pgpass file.
See PostGIS help
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a line in the .pgpass file. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PgPassUtilities.PgPassEntryFetch credentials from a specific file.static FileReturns the .pgpass file path.
-
Field Details
-
PGPASS_FILENAME
- See Also:
-
-
Constructor Details
-
PgPassUtilities
public PgPassUtilities()
-
-
Method Details
-
getCredentials
public static PgPassUtilities.PgPassEntry getCredentials(File pgPassFile, String hostname, String port, String database, String username) Fetch credentials from a specific file. See PostGIS help page- Parameters:
pgPassFile- The file to readhostname- Hostname to matchdatabase- Database name to match- Returns:
- PgPassEntry if found, null otherwise
-
getPgPassFile
Returns the .pgpass file path.- Returns:
- File containing the PostGIS database credentials
-