Loading custom configuration files

the articles posted by Ricky are very good, but unfortunately they don’t answer your question. To solve your problem you should try this piece of code: ExeConfigurationFileMap configMap = new ExeConfigurationFileMap(); configMap.ExeConfigFilename = @”d:\test\justAConfigFile.config.whateverYouLikeExtension”; Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None); If need to access a value within the config you can use the index operator: config.AppSettings.Settings[“test”].Value;

Best way to create custom config options for my Rails app?

For general application configuration that doesn’t need to be stored in a database table, I like to create a config.yml file within the config directory. For your example, it might look like this: defaults: &defaults audiocast_uri_format: http://blablalba/blabbitybla/yadda development: <<: *defaults test: <<: *defaults production: <<: *defaults This configuration file gets loaded from a custom initializer … Read more

Environment variable to control java.io.tmpdir?

According to the java.io.File Java Docs The default temporary-file directory is specified by the system property java.io.tmpdir. On UNIX systems the default value of this property is typically “/tmp” or “/var/tmp”; on Microsoft Windows systems it is typically “c:\temp”. A different value may be given to this system property when the Java virtual machine is … Read more

pgadmin4 : postgresql application server could not be contacted.

I found the same issue when upgrading to pgAdmin 4 (v1.6). On Windows I found that clearing out the content inside C:\Users\%USERNAME%\AppData\Roaming\pgAdmin\sessions folder fixed the issue for me. I believe it was attempting to use the sessions from the prior version and was failing. I know the question was marked as answered, but downgrading may … Read more

Encrypt Password in Configuration Files? [closed]

A simple way of doing this is to use Password Based Encryption in Java. This allows you to encrypt and decrypt a text by using a password. This basically means initializing a javax.crypto.Cipher with algorithm “AES/CBC/PKCS5Padding” and getting a key from javax.crypto.SecretKeyFactory with the “PBKDF2WithHmacSHA512” algorithm. Here is a code example (updated to replace the … Read more

If using maven, usually you put log4j.properties under java or resources?

src/main/resources is the “standard placement” for this. Update: The above answers the question, but its not the best solution. Check out the other answers and the comments on this … you would probably not shipping your own logging properties with the jar but instead leave it to the client (for example app-server, stage environment, etc) … Read more