public static int intFromProperties(Properties p,String propName,int defaultValue){
  int ret=defaultValue;
  String intString=p.getProperty(propName);
  if (intString != null) {
    try {
      ret=Integer.parseInt(intString.trim());
    }
 catch (    NumberFormatException e) {
      ret=defaultValue;
    }
  }
  return ret;
}

public static int intFromProperties ( Properties p , String propName , int defaultValue ) { int ret = defaultValue ; String intString = p . getProperty ( propName ) ; if ( intString != null ) { try { ret = Integer . parseInt ( intString . trim ( ) ) ; } catch ( NumberFormatException e ) { ret = defaultValue ; } } return ret ; }
gets an integer out of a properties object . returns the default value if something goes wrong .
