settings.properties

Issue #212 resolved
Benjamin Cordes created an issue

This relates to #211.

I'd much prefer to refactor settings.properties. the reason: this is related to gradle basically. it's somehow hard to add to classpath with getResourcestream. I've fiddled with it enough, to say it's painful and relative paths should be much preferred.

the file contains two types of settings: one are relative paths, and the other are configurations.

If relative paths are used they are basically hardcoded anyway. I.e. Paths are tied to the code base no matter what. The codebase can contain loadFile(filePath) and filePath is a fixed string such as filePath = ""res/currencies". It's a final static variable.

The configuration parameters reset_every_minutes, refresh_time_seconds, submit_liquidity_seconds we can fix in some config or static members.

app_name=NuBot
version=develop
res_path=res/
log_path=logs/
keystore_path=res/ssl/nubot_keystore.jks
keystore_pass="..."
frozen_folder=res/frozen/
reset_every_minutes=3
refresh_time_seconds=61
submit_liquidity_seconds=130

Comments (16)

  1. Benjamin Cordes reporter

    I introduced a StandardConfig class which contains these

    reset_every_minutes=3
    refresh_time_seconds=61
    submit_liquidity_seconds=130
    
  2. Benjamin Cordes reporter

    basically this breaks for me within gradle. if we use relative paths the issue will go away.

    public static void loadProperties(String filename) {
            Global.settings = new Properties();
            InputStream input = null;
    
            try {
    
                input = NuBot.class.getClassLoader().getResourceAsStream(filename);
    
  3. Log in to comment