Opened 3 years ago

Last modified 3 years ago

#823 assigned

Properties file for connection properties

Reported by: olle Owned by: olle
Milestone: Proteios SE 2.20.0 Keywords:
Cc:

Description

Support should be added for reading connection properties from a properties file.

Change History (6)

comment:1 Changed 3 years ago by olle

  • Status changed from new to assigned

Ticket accepted.

comment:2 Changed 3 years ago by olle

Design description:

  1. New connection properties template file conf/connection.properties.in in client/servlet/ added. It contains settings for accessing files using SSL (Secure Sockets Layer) connection, and redirects for local cache when accessing files via URL.
  2. Outermost Ant build file build.xml updated to include files connection.properties* when copying files from client/servlet/conf/ to www/WEB-INF/classes/ in distribution directory.
  3. New class/file ConnectionPropertiesFile.java in api/core/ added. It loads connection.properties file and gives access to the settings in the latter.
  4. Class/file core/Application.java in api/core/ updated:
    a. Private static method void createSSLFactory() updated to call new private static method String fetchProperty(Properties pf, String property, boolean replaceEmptyStringWithNull) to obtain property values.
    b, New private static method String fetchProperty(Properties pf, String property, boolean replaceEmptyStringWithNull) added. It fetches a property value from the properties file, if existing, otherwise from system properties. Optional replacement of empty string with null, when property value is returned.
    c. New private static method String fetchProperty(Properties pf, String property) added. It calls new private static method String fetchProperty(Properties pf, String property, boolean replaceEmptyStringWithNull) with argument replaceEmptyStringWithNull set to false, to obtain the vallue to return.

comment:3 Changed 3 years ago by olle

(In [4542]) Refs #823. First version of support for reading connection properties from a properties file:

  1. New connection properties template file conf/connection.properties.in in client/servlet/ added. It contains settings for accessing files using SSL (Secure Sockets Layer) connection, and redirects for local cache when accessing files via URL.
  2. Outermost Ant build file build.xml updated to include files connection.properties* when copying files from client/servlet/conf/ to www/WEB-INF/classes/ in distribution directory.
  3. New class/file ConnectionPropertiesFile.java in api/core/ added. It loads connection.properties file and gives access to the settings in the latter.
  4. Class/file core/Application.java in api/core/ updated:
    a. Private static method void createSSLFactory() updated to call new private static method String fetchProperty(Properties pf, String property, boolean replaceEmptyStringWithNull) to obtain property values.
    b, New private static method String fetchProperty(Properties pf, String property, boolean replaceEmptyStringWithNull) added. It fetches a property value from the properties file, if existing, otherwise from system properties. Optional replacement of empty string with null, when property value is returned.
    c. New private static method String fetchProperty(Properties pf, String property) added. It calls new private static method String fetchProperty(Properties pf, String property, boolean replaceEmptyStringWithNull) with argument replaceEmptyStringWithNull set to false, to obtain the vallue to return.

comment:4 Changed 3 years ago by olle

(In [4543]) Refs #823. Loading of connection property values in class/file core/Application.java in api/core/ updated:

  1. Private static method String fetchProperty(Properties pf, String property, boolean replaceEmptyStringWithNull) updated to use log.info() calls for logging output, instead of log.debug().

comment:5 Changed 3 years ago by fredrik

(In [4544]) Refs #823. Avoiding null pointer exception if connection properties file missing.

comment:6 Changed 3 years ago by fredrik

(In [4551]) Refs #630. Added support for URIs with basic authentication. Refs #823. Added possibilities to specify alternate URIs in connection-properties file. Updated installation scripts for the connection-properties file.

Note: See TracTickets for help on using tickets.