Mercurial > hg > release > thermostat-0.13
changeset 181:def361b04147
Remove required argument --properties from the client
Reviewed-by: neugens
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2012-March/000606.html
author | Omair Majid <omajid@redhat.com> |
---|---|
date | Fri, 30 Mar 2012 17:28:08 -0400 |
parents | 4bced100ed3f |
children | 4f2137a2f3d8 |
files | client/src/main/java/com/redhat/thermostat/client/ClientArgs.java |
diffstat | 1 files changed, 0 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/main/java/com/redhat/thermostat/client/ClientArgs.java Fri Mar 30 15:43:37 2012 -0400 +++ b/client/src/main/java/com/redhat/thermostat/client/ClientArgs.java Fri Mar 30 17:28:08 2012 -0400 @@ -36,51 +36,22 @@ package com.redhat.thermostat.client; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.Reader; -import java.util.Properties; - public class ClientArgs { private boolean isDebugLayout = Boolean.getBoolean("thermostat.debug-layout"); - private Properties props = new Properties(); public ClientArgs(String[] args) { - boolean hasValidPropertiesArg = false; for (int i=0; i < args.length; i++) { if (args[i].equals("--debug-layout")) { isDebugLayout = true; - } else if (args[i].equals("--properties")) { - i++; - if (i >= args.length) { - throw new IllegalArgumentException("--properties argument requires filename."); - } - try (Reader reader = new FileReader(args[i])){ - props.load(reader); - } catch (FileNotFoundException e) { - // ignore - } catch (IOException e) { - // ignore - } - // Ok props file must be good. - hasValidPropertiesArg = true; } } - if (!hasValidPropertiesArg) { - throw new IllegalArgumentException("Properties argument with valid properties file is required."); - } // TODO what other arguments do we care about? // perhaps skipping the mode selection? - } public boolean isDebugLayout() { return isDebugLayout; } - public Properties getProperties() { - return props; - } }