Package org.postgresql.jdbcurlresolver
Class PgServiceConfParser
- java.lang.Object
-
- org.postgresql.jdbcurlresolver.PgServiceConfParser
-
public class PgServiceConfParser extends java.lang.Object
helps to read Connection Service File. https://www.postgresql.org/docs/current/libpq-pgservice.html
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
ignoreIfOpenFails
private static java.util.logging.Logger
LOGGER
private java.lang.String
serviceName
-
Constructor Summary
Constructors Modifier Constructor Description private
PgServiceConfParser(java.lang.String serviceName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
findPgServiceConfResourceName()
private java.util.Properties
findServiceDescription()
static java.util.Properties
getServiceProperties(java.lang.String serviceName)
Read pg_service.conf resourceprivate java.io.InputStream
openInputStream(java.lang.String resourceName)
private java.util.Properties
parseInputStream(java.io.InputStream inputStream)
-
-
-
Method Detail
-
getServiceProperties
public static java.util.Properties getServiceProperties(java.lang.String serviceName)
Read pg_service.conf resource- Parameters:
serviceName
- service name to search for- Returns:
- key value pairs
-
findServiceDescription
private java.util.Properties findServiceDescription()
-
openInputStream
private java.io.InputStream openInputStream(java.lang.String resourceName) throws java.io.IOException
- Throws:
java.io.IOException
-
findPgServiceConfResourceName
private java.lang.String findPgServiceConfResourceName()
-
parseInputStream
private java.util.Properties parseInputStream(java.io.InputStream inputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
-